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

concerning opening recordset of parameter query

Status
Not open for further replies.

callipygous

Technical User
Jun 19, 2003
10
GB
Hi there,
Would appreciate some help with a bit of code that will open the recordset of a parameter query that needs a text entry (persons name from combobox) to run.

cheers
Simon
 
The basic SQL statement will be built similar to the following,

strSQL="Select * From table1 Where field1='" & combo1.text & "'"

The exact syntax will depend on your database and data access object. You can substitute any variable in place of the combo box. If field1 is numeric then remove the single quotes.

If this does not answer your question post more details about the database and tools that you are using.

Thanks and Good Luck!

zemp
 
Sorry, not getting it.

This is in a Public Sub VBA procedure
i was using
set rst = db.OpenRecordset("qry",dbOpenDynaset)

rst is recordset
db is my database

but now qry needs the text input to run.
 
You are using DAO or are you writing VBA code in an Access form or module? To be honest it has been years since I last worked with DAO or within Access. Sorry, I was thinking ADO when I answered your question.

If no one responds with helpful information and you are coding Access VBA you can try one of thye Access forums (forum701 for example).

Thanks and Good Luck!

zemp
 
Yes, its pretty old - DAO etc in an access module - thanks for your help, I'll try that other forum
Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top