safeerbinsalih
Registered User.
- Local time
- Tomorrow, 01:52
- Joined
- Dec 30, 2015
- Messages
- 26
Hi,
I've got syntax error in date expression in an SQL command
Dim db As Database
Dim rs As Recordset
Dim temp3, As Date
Dim temp1 As Long
Set db = CurrentDb()
Set rs = db.OpenRecordset("tblSale_order")
temp1 = Me.MID
temp3 = Me.txtexpecteddeliverydate
strSQL = "UPDATE [tblSale_order] SET [Expected_delivery_date] = #" & Format(temp3, dd - mm - yyyy) & "# WHERE [ID] = " & temp1 & ";"
db.Execute strSQL, dbFailOnError
MsgBox "Follow up details updated successfully", vbInformation, Message
Set rs = Nothing
Set db = Nothing
The code highlighted in red is throwing an error. Any help is highly appreciated
I've got syntax error in date expression in an SQL command
Dim db As Database
Dim rs As Recordset
Dim temp3, As Date
Dim temp1 As Long
Set db = CurrentDb()
Set rs = db.OpenRecordset("tblSale_order")
temp1 = Me.MID
temp3 = Me.txtexpecteddeliverydate
strSQL = "UPDATE [tblSale_order] SET [Expected_delivery_date] = #" & Format(temp3, dd - mm - yyyy) & "# WHERE [ID] = " & temp1 & ";"
db.Execute strSQL, dbFailOnError
MsgBox "Follow up details updated successfully", vbInformation, Message
Set rs = Nothing
Set db = Nothing
The code highlighted in red is throwing an error. Any help is highly appreciated