I need help
I'm trying to insert a row into a table using data from variables with values from an excel sheet. the problem I'm having is that the table I'm inserting them into has an Auto_increment field and I can't get the code right for it to work. Here is a sample of what I have:
Code
' ProjectNum is the Auto_increment field
INSERT INTO ProjectData ( ProjectNum, CompanyName, ProjectName, Latitude, Longitude, StateName, TotalPrints, TotalDiapos, FltLinesH, FltLinesM, FltLinesL, PhotoScaleH, GoDate, CreationDate, FlownDate, InvoiceDate )
VALUES (null, '" & GName & "', '" & ProjectName & "', '" & Lat & "', '" & Lon & "', '" & StateName & "', '" & NumPrints & "', '" & NumPos & "', '" & FltlinesH & "', '" & FltlinesM & "', 0, '" & PhotoScaleH & "', '', '" & Date & "', '', '');
When I run this I get Error Msg "You tried to assign the null value to a variable that is not a Variant data type"
If I change the null to a number I get Error Msg "Microsof set 1 field(s) to null due to a type convertion failure..." and doesn't append the record.
any help and or example code would be greatly appreciated. Thanks in advance
I'm trying to insert a row into a table using data from variables with values from an excel sheet. the problem I'm having is that the table I'm inserting them into has an Auto_increment field and I can't get the code right for it to work. Here is a sample of what I have:
Code
' ProjectNum is the Auto_increment field
INSERT INTO ProjectData ( ProjectNum, CompanyName, ProjectName, Latitude, Longitude, StateName, TotalPrints, TotalDiapos, FltLinesH, FltLinesM, FltLinesL, PhotoScaleH, GoDate, CreationDate, FlownDate, InvoiceDate )
VALUES (null, '" & GName & "', '" & ProjectName & "', '" & Lat & "', '" & Lon & "', '" & StateName & "', '" & NumPrints & "', '" & NumPos & "', '" & FltlinesH & "', '" & FltlinesM & "', 0, '" & PhotoScaleH & "', '', '" & Date & "', '', '');
When I run this I get Error Msg "You tried to assign the null value to a variable that is not a Variant data type"
If I change the null to a number I get Error Msg "Microsof set 1 field(s) to null due to a type convertion failure..." and doesn't append the record.
any help and or example code would be greatly appreciated. Thanks in advance