F
fgs
Guest
Hi all,
I am very new to the world of VBA and I have a problem. I took over for a programer who was in the middle of developng a data entry form for our database. It created records in a tempory table and on exit and saving it ran an append query and added the new records to the live data. However when I run the program I get a syntax error in the following code:
I was wondering if it is a syntax error that I am missing or if it has something to do with the inclusion of a variable in the append or something more complicated?
The more complicated has to do with the key for the coordinate table, it is an autonumber that is generated when the other data is added, I am assuming it is still automated when these fields are inserted in to the table but perhaps it is not and that is the error?
Any help would be GREATLY APPRECIATED!!!
Thanks
I am very new to the world of VBA and I have a problem. I took over for a programer who was in the middle of developng a data entry form for our database. It created records in a tempory table and on exit and saving it ran an append query and added the new records to the live data. However when I run the program I get a syntax error in the following code:
Code:
'Update Coordinate table
DoCmd.RunSQL "INSERT INTO Coordinate ( WellID, LocationMethodID, DatumTypeID, LatDD, LatMM, LatSS, LonDD, LonMM, LonSS, Township, NSCardinal, Range, EWCardinal, [Section], Quarter1, Quarter2, Quarter3, Quarter4, Quarters, Northing, Easting, TownshipRange, LatDecimal, LonDecimal )" & _
"SELECT " & varWellID & ", tblCoordinate.LocationMethodID, tblCoordinate.DatumTypeID, tblCoordinate.LatDD, tblCoordinate.LatMM, tblCoordinate.LatSS, tblCoordinate.LonDD, tblCoordinate.LonMM, tblCoordinate.LonSS, tblCoordinate.Township, tblCoordinate.NSCardinal, tblCoordinate.Range, tblCoordinate.EWCardinal, tblCoordinate.Section, tblCoordinate.Quarter1, tblCoordinate.Quarter2, tblCoordinate.Quarter3, tblCoordinate.Quarter4, tblCoordinate.Quarters, tblCoordinate.Northing, tblCoordinate.Easting, tblCoordinate.TownshipRange, tblCoordinate.LatDecimal, tblCoordinate.LonDecimal " & _
"FROM tblCoordinate"
I was wondering if it is a syntax error that I am missing or if it has something to do with the inclusion of a variable in the append or something more complicated?
The more complicated has to do with the key for the coordinate table, it is an autonumber that is generated when the other data is added, I am assuming it is still automated when these fields are inserted in to the table but perhaps it is not and that is the error?
Any help would be GREATLY APPRECIATED!!!
Thanks