irunergoiam
Registered User.
- Local time
- Yesterday, 18:56
- Joined
- May 30, 2009
- Messages
- 76
I am trying to create an INSERT statement from a form to put unbound fields in a table. The challenge that I am a getting is that I am getting a
Run-time error '3075' Syntax error in date in query expression '#'
What is really perplexing and perhaps something that may guide in identifying the culprit is that I have an identifcal form that uses the identical code and it works.
If it helps, here is the code below:
Dim strSQL As String
Dim strCriteria As String
strSQL = ""
strSQL = strSQL & " INSERT INTO [tblTicket]"
strSQL = strSQL & " ([UpdatedBy], [AssignedTo], [Requestor], [Dept], [DateRequested], [TimeRequested], [DateTimeOpened], [DateOpened], [TimeOpened], [DateLastAction], [TimeLastAction], [Description])"
strSQL = strSQL & " Values"
strSQL = strSQL & " ('" & unbEnteredBy & "','" & cmbAssignedTo & "','" & cmbRequestor & "','" & cmbDepartment & "',#" & unbDateRequested & "#,#" & unbTimeRequested & "#,#" & unbDateTimeOpened & "#,#" & unbDateOpened & "#,#" & unbTimeOpened & "#,#" & unbLastFollowUpDate & "#,#" & unbLastFollowUpTime & "#,'" & unbDesc & "')"
CurrentDb.Execute strSQL, dbFailOnError
Run-time error '3075' Syntax error in date in query expression '#'
What is really perplexing and perhaps something that may guide in identifying the culprit is that I have an identifcal form that uses the identical code and it works.
If it helps, here is the code below:
Dim strSQL As String
Dim strCriteria As String
strSQL = ""
strSQL = strSQL & " INSERT INTO [tblTicket]"
strSQL = strSQL & " ([UpdatedBy], [AssignedTo], [Requestor], [Dept], [DateRequested], [TimeRequested], [DateTimeOpened], [DateOpened], [TimeOpened], [DateLastAction], [TimeLastAction], [Description])"
strSQL = strSQL & " Values"
strSQL = strSQL & " ('" & unbEnteredBy & "','" & cmbAssignedTo & "','" & cmbRequestor & "','" & cmbDepartment & "',#" & unbDateRequested & "#,#" & unbTimeRequested & "#,#" & unbDateTimeOpened & "#,#" & unbDateOpened & "#,#" & unbTimeOpened & "#,#" & unbLastFollowUpDate & "#,#" & unbLastFollowUpTime & "#,'" & unbDesc & "')"
CurrentDb.Execute strSQL, dbFailOnError