query as recordset frustration for newbie

arkres

Registered User.
Local time
Today, 21:51
Joined
Sep 26, 2001
Messages
62
Hi,

I'm new to vba. I am trying to get a clear example of creating a recordset with a query for the purpose of creating an email message using the details of that query. I know how to do this if I am looping through the records in that query, or if I use a make-table query, but I cannot find an understandable example of this if I want to open the query using a parameter entered by the user (such as an ID number). Can someone please point me in the right direction? It would be much appreciated. Thanks much.

Pat
 
If hosted on a form that exposes a textbox named 'ID' ...
Code:
dim rst as dao.recordset
set rst = currentdb.openrecordset( _
  "SELECT field FROM table WHERE ID = " & me.id)
debug.print !field
 
Thank You !!!!
 

Users who are viewing this thread

Back
Top Bottom