checkoutList = "SELECT Checkouts.CheckoutID, Checkouts.IssuerName as [NAME], Checkouts.Tel as [TEL], Checkouts.email as [EMAIL], checkouts.startdate as [DATE ISSUED], checkouts.enddate as [RETURN DATE]" & _
dbCW.Execute ("UPDATE checkouts set [enddate] = #" & Date & "# where [checkoutid] ='" & checklist.checkoutID & "'")
CheckoutID is autonumber
There seems to be something wrong with the syntax, could someone help me out
If you are using a form to do this, then why can't you can include the checkin date in the forms recordsource and just enter the date in the form field? If you don't have access by a form field then you can do this with DAO.
Update method like this.
Dim rst As Recordset
Dim recIndex As Integer
Dim strQry As String
recIndex = "'" & Me.checkoutID
strQry = "SELECT checkouts.checkoutid, checkouts.enddate" & _
" FROM [checkouts]" & _
"WHERE (((checkouts.checkoutid)=" & recIndex & "))"
Set rst = CurrentDb.OpenRecordset(strQry, dbOpenDynaset)
If .RecordCount = 1 Then
If IsNull(![enddate]) Then
![enddate] = Now()
MsgBox "Date Updated"
MsgBox "A unique record Index for checkoutid# '" & recIndex & "' was not found"