entering query results into a variable in VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm new to Access VBA, But i've used VBA in other office products

I would like to take the results of a query and place those results in a
variable.
I then want to use that variable as criteria in another query.

For example:

Dim age1 as integer

age1 = Select age from Table1 where SSN='000-11-2222'

Select * from Table1 where age1-2<age<age1+2

Any idea on how to do this?

Thanks
 
Check out the DLookup() function in the help file.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Back
Top