Locking a table based on query results

I have a query that checks an expiration date field and displays the word "Expired" in another field if applicable. This query is used to look up items, then the user would enter whether or not it is approved right in the resulting data grid thereby entering that approval into the table being used for the query. Can I do something with the query so that if the item returned has expired, a user would not be able to enter anything into the approval field Something like, if field1 = "expired" then lock the table I can't use a form, I have to just do it in the basic query or forget it. I would very much appreciate any suggestions!

Posted On: Monday 22nd of October 2012 05:32:47 AM Total Views:  662
View Complete with Replies

Related Messages:

Button for Unlocking Records   (146 Views)
I have a form that displays the search results of a query. of the fields in the form are locked to prevent accidental changes. I would like to have a button on the form that would unlock the fields so they can be edited if necessary. Can this be done
Intermittent problems with record locking   (215 Views)
hi, I've got a database that is split -front/back on a server. It is used by roughly 5 people. Usually one or two people use it at one time, with one of the users who leaves the application open at all times. Sometimes when the users are working in the screen, which would be in the subform, an error like "record is locked" pops up and they cannot enter any data. This happens on a date field where I have put some code to auto fill the date if the previous record has today's date in it. It doesn't seem like it should be locking on that. Should it This is what I have in the code: Code: Option Compare Database Public DateValue As Date Public DatePresent As Boolean Private Sub DateLog_AfterUpdate() 'fill the date with previous entry - if it has been entered in same session DateValue = Me.DateLog.Value DatePresent = True End Sub Private Sub DateLog_GotFocus() If (DatePresent) Then Me.DateLog.Value = DateValue End If End Sub Private Sub Form_Load() Me.Requery DatePresent = False End Sub
Link of combobox from same table   (283 Views)
I thought i had this fixed, but i cant seem to get this working. I have 1 table called AGENTALL and i have 2 colums. Agents and manager. So it would look like Agent Manager Dave Carmen Bill Gates There each agent has an assigned manager. I have a form that has 2 combo boxes, 1 agents(cmbagent) and 1 managers(cmbmanager) I need this to work like if i select manager it lists the managers, which works and if i select a specific manager the agent combobox will only be populated with the agent names associated to it. Anyone able to assist it would be greatly appreciated.
What a mess I am in with just two tables   (156 Views)
I can not beleve it I have just designed a data base with tables ,queries, a switchboard,apend table/querie, an delete table/querie etc (all self taught) but the last thing I have to do is take the data from 1 table and idata from another table and put it together BUT!! table 1(orders) has space(Key),Customer,Order date, use buy date,Quantity, Product, Discription(no data in this field after apend), Date out (no Data in this field after apend)and a yes no box for delete(no data in this field after apend),Table two(Deleted) has the same data except it has data in the discription,date out and deleted fields. When I fill out the form (orders) I put a date out and tick the check box to delete the order. my apend querie takes anything with a tick and puts it in the deleted table and then my deleted querie deletes it off the orders table. Hope you are still with me!! So I want to do a querie that gives me all orders both the current and deleted but not duplicate the customer name. Hope that makes sence
Macros to update table?   (179 Views)
Okay, here's what I'm trying to do... I have a form, and I want to be able to automatically log the time that users are working on that particular project. This is my thought process, and I just can't get it to work. I'm using Access2000, and I'm still somewhat new to figuring it out. 1st Time button - start time - this would be a macro that goes and updates a table that has the start time, end time, project id and an autonumber field (so it will just keep adding to the table). There would be a date & time stamp that goes into the start time column. 2nd Time button - end time - Same basic function - it would put a date/time stamp into the end time field. I want to use this to create a record to show how long the user was working on the project (end time - start time = time worked). I've tried setting up macros, and I can't get them to actually update the table. I've had little experience with macros and I could really use some help.
Logging Form Access to a table   (159 Views)
I have some code that I am using to log users going into a series of Forms in my database. Right the code rights the info to a text file and I have programmed and Even procedure for every form. What I would like to be able to do is instead of writing the data to a txt file I would like it to write the info to my table in my database. Here is the current code. Function Punch_List_Entry1() Dim lngFile As Long lngFile = FreeFile Open "M:\Turnover\log\databaselog.txt" For Append As #lngFile Print #lngFile, Environ("COMPUTERNAME") & "," & CurrentUser & "," & Now & ",Entering Punch List Data Entry" Close #lngFile End Function I know how to call up the insert statement to enter in the last item which tells me what form they entered but I don't know how to insert the enviroment items. Also in access is there a way of inserting the form name instead of having to hard code it into each form This is the code that I was trying to use. Private Sub cmdEnterData_Click() DoCmd.RunSQL "INSERT INTO LogUser_tbl (" & _ "ComputerName, CurrentUser, Date_Time, Object_Accessed) " & _ "VALUES" (Environ("COMPUTERNAME") & "","" & CurrentUser & "","" & Now & "",Entering Integrated Turnover Database"") End Sub
Kinda like recent post Macro Updates table   (167 Views)
ok i have this query. Code: UPDATE [Claims Header] SET [Claims Header].status = 'I' WHERE ((([Claims Header].Claim_ID)=[claim id])); WHERE ((([Claims Header].Claim_ID)=[claim id])); i want to have a button that runs this query but how do i pass over the claimid from my form also when it's done running the query i want it to run a report. so i was trying to make a macro, but how do i tell the macro to find the claim id from the form
Update mutilple tables with one table?   (241 Views)
i'm trying to add my primary key to multiple tables with a query/macro. how should i do this
Problem - tables   (157 Views)
hey i have 2 tables : big (primery) , small (sub). i want that the sub-form will get automaticcly the numberof the primery i.e : when the deal number = 2 , all the "deal number" fields in the sub-form (small) get "deal number=2" automaticcly .
Link columns in two tables??   (142 Views)
I have been able to link column A1 in Table A to Column B1 in Table B. But I want to link Columns A2,A3,A4 to Columns in table B using A1 and B1 as the relationship. Can this be done I want to end up with a Table that would be automaticly updated with the columns.
Updating oracle backend tables from MS access forms(dynamically)??   (411 Views)
, My requirement is this... I have to use MS Access as front end with ODBC connection to Oracle 9i DB. The application(forms) should be able to update, delete ,insert records into oracle tables(backend). i have a main form,which has some unique id's and other info about the ids and the subform shows several matching id's for that unique id in main form. the user who uses this application should be able to 1) search for the unique id in the main form such that the subform displays all its matches 2) they should be able to select anyone match and say approve(there can only be one match), then that particular record should be updated in the table.IF I USE A CHECK BOX AND IF THEY CLICK ON ONE RECORD AS MATCH,HOW DO I TAKE THAT RECORD SAY THE ID , NAME ADDRESS AND ALL DETAILS AND UPDATE THE TABLE similarly when they select some other record i should give option of deleting other irrelevant matches in the backend table. the main form and the subform uses the same table as source.updates are to another table, i should also have to put entry into audit table about which record was deleted and which one inserted.. How should i do this i am new to MS access .VBA, any help would be highly appreciated!
Locking table after entry   (228 Views)
I have created a part number generator for our Manufacturing company. Usualy there are a few changes on some of the information within a few days of being created. Is there a way to lock information in certain rows, after it is finalized
Updating a table   (278 Views)
I have a form with a subform (main form is "frm_Maintenance_Request_2" and sub form is "subfrm_Job_Costs". The main form has a field called "GrandTotal" which is draws from a calculation on the sub form.) What I want to be able to do is that once the field has the calculation it updates a field called "Estimate_Cost" in the table "tbl_Maintnenance_Request". Can I do this without running an update query I would prefer to use an Event Procedure that says something like afterUpdate: tbl_Maintnenance_Request!Estimate_Cost = Forms!frm_Maintenance_Request_2!GrandTotal Can you help please
Simple lookups in table   (199 Views)
Simple questions I hope. 1. What I'd like to do is do a lookup based on 2 fields in my table. I'm tracking inventory for the company I am currently working with. I have a computer table with 3 relevant fields: compID, areaId, locationId computer table compID = PK for this table areaId = FK from area table locationId = FK from location table area table areaId location table locationId areaId There is a distinct relationship between area + location. I want a lookup for the locationID, based on the area they have selected.
2 fields point at same table   (260 Views)
I have 2 fields in my table - cityID and offcityID - I want to create a query that ties the cityID to the city table cityID and offcityID ties the offcityID to the city table cityID I am not getting the correct amount of records when I set this up. Code: SELECT [main changed].lastname, [main changed].firstname, [main changed].address, City.City, [main changed].business, [main changed].offaddress, City.City FROM [main changed] INNER JOIN City ON ([main changed].cityID = City.CityID) AND ([main changed].offcityID = City.CityID); I should have 1898 records - when I have the AND in I get 227 records and when I have the OR in I get 2176 records. Neither is correct
Import all data tables   (152 Views)
Hi all How do i import all data tables from another database using code
Importing multiple excel sheets into an Access DB/table   (161 Views)
I've been trying to load data from multiple excel worksheets in multiple workbooks into one table in Access. The first one loads fine, but after that I get errors and can't load anything else. of the sheets are in the same format, so that shouldn't be the problem. Every solution I've tried has been a bust. I want is to take all of my data and put it into one big database. Any suggestions
Lookup value from a table to input in a query   (516 Views)
I am building a mortgage/amortization database and I need to look up the "points paid" from another table and also the "adjustment to margin" based on the points paid and the index, "MTA" or "COFI". I have no idea how or where to write this lookup. Any suggestions Thank you! KellyJo
Make-table queries for Web?   (164 Views)
, I'm using MS Access 2003 for a web DB... Am wondering.. is it bad to use Make-Table queries for the web.. Or should I just do all the SQL joining and linking stuff just with more SQL code Just curious about the impact Make-Table queries have on the Web.. Slower Not a good idea
Adding data to a table   (299 Views)
hi I had a form with TO,DATE,BODY and a button . on click of a button this fileds should get added to a table. I have created a table with same fields. Thanxx