type
debug.print strSQL before you attempt to run the SQL code and see if it's giving you a valid SQL statement, you can check by cutting and pasting the sql string from your immediate window into the query designer and seeing what it's actually attempting to put into your table, but I suspect it's becaquse you're not qualifying strings and dates correctly.
For instance:
Code:
strSQL = "INSERT INTO Table_Lancaster_Dispatch (Log, Date, Dispatcher) VALUES ("
strsql = strsql & "'" & [Forms]![Form_Dispatch_New]![LogBox] & "', "
strsql = strsql & "#" & [Forms]![Form_Dispatch_New]![DateBox] & "#, "
strsql = strsql & "'" & [Forms]![Form_Dispatch_New]![DispatchBox] & "')"
I assume you're trying to insert a record into a table based on what's showing in specific fields on your form (i.e. an unbound data entry form)
For the purposes of this example I assumed LOG and DISPATCHER were text values, if either is a number you want to remove the text (') notations from the stringfor example if dispatcher is a number (FK to an employees table for example) you'd have:
Code:
strSQL = "INSERT INTO Table_Lancaster_Dispatch (Log, Date, Dispatcher) VALUES ("
strsql = strsql & "'" & [Forms]![Form_Dispatch_New]![LogBox] & "', "
strsql = strsql & "#" & [Forms]![Form_Dispatch_New]![DateBox] & "#, "
strsql = strsql & [Forms]![Form_Dispatch_New]![DispatchBox] & ")"