HELP! Need help performing a find using a macro (1 Viewer)

C

CampbelC

Guest
I only know a little about Access so plz hang in there.

What I need to be able to do is the following. I would like to just give the user a search button to click on. I would like it to go to the form and then request input in the form for what they would like to search for, then return the patient they are looking for.

Any help would really help.

Thanks,
Chris.
 

Neal

Registered User.
Local time
Today, 20:18
Joined
Feb 17, 2000
Messages
116
Have you considered doing it the other way around? Put a text box on your search form. Use that text box as the criteria for the field you are searching in a query, but include the word Like (i.e. Like [forms]![yourSearchForm]![YourTextBox]. Put a command button on your search form that opens your results form. Build the results form off the query.
I can send you a sample if you like.
 
C

CampbelC

Guest
if your could that would be great.
 

Neal

Registered User.
Local time
Today, 20:18
Joined
Feb 17, 2000
Messages
116
I've sent CampbelC a sample, but if anyone else tries this, please note that I forgot that there is an invisible field on the search form that is used to put * on either side of the search word. And that is the field used as the criteria in the query.
 

Jon.N

Registered User.
Local time
Today, 20:18
Joined
Nov 24, 2000
Messages
43
Access's own help features are quite good with this. It explains how to use a form to enter a criteria to open a form or report. The help topic's title is 'Use a form to enter report criteria'. I have used this for some time in a database but I have never been able to figure out how to get access to put the asterix * in automatically. I would be greatful if you would let me have some details on this.

[This message has been edited by Jon.N (edited 01-03-2001).]
 

Neal

Registered User.
Local time
Today, 20:18
Joined
Feb 17, 2000
Messages
116
I use a second text box on the form and set its control source to:
= "*" & [txtbox1] & "*"
It then is used as the criteria in a field in the query on which the report is based.
The query has to say:
Like [forms]![YourForm]![txtbox2]


[This message has been edited by Neal (edited 01-03-2001).]

[This message has been edited by Neal (edited 01-03-2001).]
 

Users who are viewing this thread

Top Bottom