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

Lookup the recordset

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
Hi

I work with the recordset based on query

I would like to look one field based on the another

If use dlookup it'd look like this
varName = DLookup("Field1", "QueryName", "[Last Name] = '"
& txtLastName & "'")

What should I do to achieve the same but using the recordset?

Thanks
 
SQL = "Select field1 from TableNAme where lastname = '" & txtlastName & "'"

That should give a recordset with the variable you want.
You will have to setup your connection to your database and use this sql statement with you dbconnect

Hope this helps

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top