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

VBA SQL Update 1

Status
Not open for further replies.

LizardKingSchwing

Programmer
Oct 12, 2001
96
NL
Hi

Does anyone know how to run an update SQL query in VBA to update a Table. I build up the Update Query String and need to run it based on the CurrentDb any examples would be grrrreat

Cheers

LK--<


 
LK,

Here is what I do. I first build the SQL in the query window, and copy and paste it into a code window.

dim sSQL as string
dim db as database

set db = currentDB
sSQL = &quot;Your update statement&quot; 'You said u already have this

db.execute (sSQL)
set db = nothing
db.close

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top