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

Returned value from RunSqL

Status
Not open for further replies.

Dbless

IS-IT--Management
May 8, 2002
22
US
I'm trying to run a query to see if a record exists in a particular file. If it does exists do A else do B.

How do I get the result set back from the query. I'm not updating so qrydef won't work. Have been trying runsql or execute but cannot get it to work.

Thanks
 
this code should do it.

dim rs as dao.recordset, db as dao.database, SQL as string


SQL = "SELECT * FROM
WHERE [field] = xxx;"

set db = currentdb()
set rs = db.recordsetopen( SQL)

rs.movefirst
num = rs.recordcount
if num >0 then do something
 
[worm] RunSQL only works on Action Queries. VBSlammer
redinvader3walking.gif

Unemployed in Houston, Texas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top