Updating ms access table vba dating site whit europa
I have a form named "Form1" and it has a Textbox named "Test" i would like to update the table "tbl_Room" in the field of "Room No Occupant" using vba. just wondering what if i have condition like update only if the "Room Code" (Primary Key) from the table is equal to Emp_Room from the form then it will update the Room No Occupant in the table with the same primary key?PLEASE tell me how I go about doing this, we are currently using Access 2000.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
It's probably easiest if you begin by creating new fields in your old table to match the newly added fields in the new table, with the same attributes all round.
Then populate these fields for the existing records in the old table; need to be careful here to match records correctly as you don't have a (populated) primary key in the old table; set up select query showing both old and HQ tables, and link any fields where the content will be identical in both, so that you effectively establish unique records.
Check that the results are unique by a) running a find duplicates query against the same query, and b) checking the recordcount on the select query result against the recxordcount on the old table. Once you are confident that the select query contains only unique records, change it to an update query and set the criteria for each field to be updated to Is Null, and the 'update to' box to the relevant field from the hq table.
don't put anything in the fields you want unchanged.Function Update Transaction Date() As Boolean Dim db As Database Dim LUpdate As String Dim LMsg As String Dim LTransaction Dt As Date On Error Go To Err_Execute 'Query user for Date of R LMsg = "Enter the Date of R Form __/__/____" LMsg = LMsg & Chr(10) & Chr(10) & "Format date as: mm/dd/yyyy" LTransaction Dt = Input Box(LMsg) Set db = Current Db() 'Re-Assign Date to Transaction Date LUpdate = "update [Chapter Form Bulk Input Table]" LUpdate = LUpdate & " set [Transaction Date] = #" & Format(LTransaction Dt, "mm/dd/yyyy") & "#" db.