Date combined from three combo boxes
I have an MS Access form, where a user enters the date by selecting it from three combo boxes for day, month and year. I need it to be converted to 11-Jan-2004 format and written to a table. Here is what I do:
Private Sub Form_AfterUpdate()
Dim dtDateBooked As Date
Dim strSQL As String
dtDateBooked = DateSerial(Me.cboDayBook, Me.cboMonthBook, Me.cboYearBook)
strSQL = "UPDATE tblBooking SET tblBooking.DateBooked= 'dtDateBooked'"
CurrentDb.Execute strSQL, dbFailOnError
End Sub
And I get "Type Mismatch" error on DateSerial line. Any help would be greatly appreciated. Thanks!
|