I am covering someone who is sick at work and I am having trouble getting the following piece of code working correctly, I have followed code that my colleague has used previously(as I am no expert in this) but the code keeps failing at the same point: -
Private Sub InsertOutboundDOBDetails()
Dim SQL As String
SQL = ("INSERT INTO tblOutboundDOB (AggNo, DOB, CustomerName, User, Date) " & _
" Values(" & txtAggNo & ", " & txtDOB & ", " & txtCustName & ", " & txtUser & ", " & txtDate & ")")
Debug keeps pulling me back to the red line saying there is a syntax error in INSERT INTO statement. When I hover over the variables(txtAggNo, txtDOB etc.) the information from the form is being caputured. I just cannot get it to write to the table. I have double checked the field spellings in the table etc and can see nothing obvious.
Any help on this would be greatly appreciated and I apologise for my novice take on it all.