--- Accidental Duplicate Thread, Please Delete ---
Hi all,
Im using this code to try and update collumns in a table in Access 2003.
I cant seem to get the code to work with the variables, Lookup asks to define a parameter even though it is set to the inputbox string, and test causes a type conversion error even though the table is set to Date/time.
I am very new to VBA And this is my first project.
I put the msgboxs in to check that the variables were set to the correct values before the UPDATE command, which they are.
'Update Button
Private Sub Toggle28_Click()
Dim Lookup As String
Dim test As Date
test = DateValue("Jan 01 2015")
Dim Update_QCourseData As String
Lookup = InputBox("Enter your service number", Update, " ")
MsgBox (test)
MsgBox (Lookup)
DoCmd.RunSQL ("UPDATE QCourseData " & _
"SET [Date Completed] = 'test'" & _
"WHERE [Service Number] = Lookup")
End Sub
Bookmarks