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

Run update SQL statement using VBA

Status
Not open for further replies.

ProgramError

Programmer
Joined
Mar 2, 2005
Messages
1,027
Location
GB
I have the follow SQL statement taken from a query created using the query design view in Access.

UPDATE mytable SET mytable.Printed = Yes
WHERE ((mytable.Marked) = True)


Unfortunantly the help in access is a little sparce. My intention is to alter the 'where' part of the string to lookup and update selected records (this part I can do), but I need to run this query using VBA. do I need to create a querydef? do I need to create a recordset. How do I run this sql statement in VBA

Totally Clueless!

Program Error
Why is it, I still think in terms of spectrum BASIC!
 
dim strsql
strsql = "UPDATE mytable SET mytable.Printed = Yes
WHERE ((mytable.Marked) = True)"
currentdb.execute strsql, dbfailonerror

 
Please do not crosspost thread701-1033093, see faq181-2886 for why.

Roy-Vidar
 
sorry about the cross post - wasn't sure if it was an SQL query or VBA question

Program Error
Why is it, I still think in terms of spectrum BASIC!
 
thanks lupins

Program Error
Why is it, I still think in terms of spectrum BASIC!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top