danielle.EWAIG
Registered User.
- Local time
- Tomorrow, 11:24
- Joined
- Jun 23, 2014
- Messages
- 10
Hi,
I am currently creating a form which includes a command button to update a field in a table to show Today's Date, at the time of running a query I am still yet to write.
I have the following code for my Command Button, which is returning the Runtime Error 3464 (Data type mismatch in Criteria Expression):
Private Sub cmdAddTodaysDate_Click()
CurrentDb.Execute (" UPDATE tblMyTable SET TodaysDate = " & Date & " WHERE tblMyTable.ProductCode = " & Me.txtProductCode)
End Sub
The query above seems to be having issues matching the text from the 'txtProductCode' textbox to the table field 'ProductCode'.
I've searched forums/Google for where I've gone wrong with my code, but can't seem to find it. I'm a VBA newbie; have had much more experience in Excel.
Any help is greatly appreciated!
Danielle.
I am currently creating a form which includes a command button to update a field in a table to show Today's Date, at the time of running a query I am still yet to write.
I have the following code for my Command Button, which is returning the Runtime Error 3464 (Data type mismatch in Criteria Expression):
Private Sub cmdAddTodaysDate_Click()
CurrentDb.Execute (" UPDATE tblMyTable SET TodaysDate = " & Date & " WHERE tblMyTable.ProductCode = " & Me.txtProductCode)
End Sub
The query above seems to be having issues matching the text from the 'txtProductCode' textbox to the table field 'ProductCode'.
I've searched forums/Google for where I've gone wrong with my code, but can't seem to find it. I'm a VBA newbie; have had much more experience in Excel.
Any help is greatly appreciated!
Danielle.