Link to home
Start Free TrialLog in
Avatar of schuitkds
schuitkds

asked on

Access 2007 VB SQL

Hello
Relatively new to the access sql vb thing.
What I would like to do is be able to search a recordset for only the first record and if that is found then proceed to update a table or variable.

not quite sure how to structure this
any help would be very much appreciated.
thank you
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of schuitkds
schuitkds

ASKER

nice but what i want is it to find the first record and if a record exists then process some code.
I do not want it to loop through every record
just detect if a record exists and execute code
My proposed solution will not loop through all records.  It does a SELECT with a COUNT() which will only return 1 "row" of the total count of records that matched your criteria.

You have not said that you need access to the columns from a single matching row, but that could be done as well.

My logic basically said "are there any records that matched some criteria" and if the answer was yes allowed you to execute some logic.  But it didn't return all rows or loop at all.

~bp