Text in text box as criteria in query.

normski

Registered User.
Local time
Today, 11:57
Joined
Dec 8, 2006
Messages
20
Hi, How can I make the data in a textbox on my form automatically entered as the search criteria in a query. So say the box says Mike Johnson, can I make a command button (That I can eventually subsititute as the actual box) that puts the Nma emIk Johnson into a search query and brings up all the information on him from the database?
 
It is better to use Combo Box enstead of Text box.
In any case, in query criteria put [Forms]![Form Name]![Field Name].
 
Ok thanks. It now loads up the report from clicking on the text box (it says felopinine in it) and it is working perfectly except that whichever drug name I click on on any record it loads up felodipine as the drug instead of automatically substituting felo. as which ever drug is typed into the text box that im clicking on.

Database.jpg
 
MStef said:
It is better to use Combo Box enstead of Text box.
This is the bit you didn't do. It looks as if your form is bound to the drug table and no matter what you enter into the Drug Name Text box, you are picking up the ID of 20. What you really need is a three column combo. First Column would be the ID which is really the value you want as the cirterion for your query. I would hide this from the user by reducing the column width to zero. Second column would be the generic drug name and third the brand name.
 
K thanks Ill try that sometime, I think ive already done it with the patient list (see header)
 

Users who are viewing this thread

Back
Top Bottom