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!

Query Table for Item

Status
Not open for further replies.

STibbs

Programmer
Apr 1, 2002
17
CA
I am new to the programming world of ACCESS 2000. I want to find out if there is are specific records in a table. If there are no records then I want to run an access query to append records from another table to make the query true. If they already exist, I wish to do nothing but run a report. Can some one suggest a spot I can go to learn more or have code that will give me an Idea as to how this would all work?
 
Try something like this (Query1 is the SQL statement for your select query, Query2 is the SQL statement for your append query
Code:
dim RS as new ADODB.recordset

Set RS = currentproject.connection.execute(query1)

If RS.EOF then
    currentdb.execute(query2)
else
    'open your report
end if

RS.close
set RS = nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top