Hello I have a form where the use will enter a new expiration date and fill in their name for tracking. I currently have them entering the new expiration date and name in two blank unbound text boxes. I attacked an image to help show what im trying to do.
The "New Expiration Date" and "Updated By" sections in the Green box are the unbound text boxes these are where the user will enter their New expiration date and fill in their name.
The Fields in the Red box are from the table "CalItemT". The Red Box is for Info only it can not be changed or even selected on this form. The Info Displayed here is dependent on the Serial Number Selected in the Blue Box.
The Blue Box is the Serial Number of the Cal Item being updated. Its the Primary key field for the "CalItemT" table.
When they click the Save and Exit button I want the "Previous Expiration" and Previous Updated By" data in the Red Box to be replaced with the "New Expiration Date" and "Updated By" Data in the Green box.
I added Text to the Image to show Field names or text Box Names and what table they link to.
I only have the Updated by section in the code right now as i figure i can just copy and paste and change a few names to get it to work for the new expiration date once i get it working.
I tried using this code to do it but i get a 3144 Syntax error
Code:
Dim SQL As String
SQL = "UPDATE CalItemT" & _
"SET [CalItemT].[UpdatedBy] = [Me.UpdateBy]" & _
"WHERE SerialNum = Me.ComboboxSerNum "
DoCmd.RunSQL SQL
any help will be great.
Even if you know of a different method for doing what i am trying to do suggest it and i will see if it will work for me
Thanks