Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having trouble inserting text box date value into an SQL VBA insert

Status
Not open for further replies.

Pack10

Programmer
Feb 3, 2010
495
US
I am building a rather large SQL insert statement.
I have a few date fields to insert values from text boxes on a form. I am having trouble getting the syntax correct.

 
The insert is very long. It works up to the txtUnAcknowledged field, when I add the txtLOA_Date I get syntax error every time I try something. Again, the value is coming from a text box on the form and I want to insert it into a date field in a table.



Values( " & Forms!frmTasksUpdate!txtUnAcknowledged & " , #" & Forms!frmTasksUpdate!txtLOA_Date & "# );
 
My apologies, the code does work. I did not have a value in the text field. So my question is....if there is no value in the field which could be the case, how would I handle that...
 
So basically the SQL insert wont't work in this situation and I should use and "AddNew" and write the values to the fields and then do an update. Agree?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top