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

Access Project Updating a SQL table

Status
Not open for further replies.

lh100

Programmer
Aug 22, 2002
3
0
0
US
I have a module that returns a value that I need to place in a sql table. I'm used to using access and sqlpassthrough queries. When I try to execute the sql statement I get (run time error 91 - object variable or with block variable not set). I'm not sure how to set the connections. Here's a portion of the code I have:

Dim db As Database
Dim sql As String
intcnt = 0

Set db = CurrentDb()

sql = "Insert into fridays_in_month values (" & intcnt & ")"

db.Execute sql
Thanks in advance for replies.

 
Dim db As DAO.Database

Make sure you have the reference library for DAO checked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top