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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insertdata into ACCESS table from Recordset 4

Status
Not open for further replies.

jpl458

Technical User
Sep 30, 2009
337
US

Want to insert a record from a recordset into and existing empty ACCESS table. The following code is inside some loops, but the code bombs on the docmd.RunSQL addata with this error:
Invalid use of '.','!',or (). in query expression
BallsRs.Fields(0).Value.
Just testing to get the insert running so only inserting one field for now-the first column in the record set.

Dim addata As Variant
addata = "INSERT INTO BallsTableTest(Account_Number) Select BallsRs.fields(0).value as Account_Number"
DoCmd.SetWarnings False
docmd.RunSQL addata
DoCmd.SetWarnings True

Thanks in advance

jpl
 
Sorry, understand. Will read up on it.

Thanks for all the help though.

jpl
 
jpl458,
Make sure you come back if you have any questions about debugging. Bottom line is we would rather teach you how to debug and understand your code rather than simply fix it ;-)


Duane
Hook'D on Access
MS Access MVP
 
You did not replay to my post from 25 Nov 13 12:40

Would the other approach be applicable to your situation?

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top