T
tdemartino
I found this code from 10/2002 to help me with creating a search in
Access. I have it 1/2 working, when I open the first form (form1), it
first open the query to ask what I'm searching for, then it opens the
Paraform for me to input again what I'm searching for.
Did I miss something in the code instruction?
Thanks,
TraceyDee
I would like to have a search option in my form to search *, in a field
or group of fields.
---------------------------------------------------------------------------------------------------------------------------------------------
From: Fredg - view profile
Date: Wed, Oct 16 2002 8:31 am
Email: "Fredg" <[email protected]>
Groups: comp.databases.ms-access
Not yet ratedRating:
show options
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse | Find messages by this author
Chris,
Make a new Query, based upon whatever table(s) you require to get the
data
you need.
On the Field to be searched's Criteria line, write:
Like "*" & forms!ParamForm!SearchFor & "*"
Make a new Form, using the query as Record Source.
Code the Form's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog
Code the Form's Close event:
DoCmd.Close acForm, "ParamForm"
Next, make a new Form.
Add a text control for each different field of data you wish to search
for.
(I'm going to use just one here.)
Name it SearchFor.
Add a Command Button.
Code the button's Click event:
Me.Visible = False
Name this form ParamForm.
When you are ready to search your database, open the first form.
It will open the ParamForm.
Enter the search word or phrase.
Click the Command Button.
The form will show all records that contain that word/phrase anywhere
in the
appropriate field.
When you close the form, the ParamForm will also close.
Access. I have it 1/2 working, when I open the first form (form1), it
first open the query to ask what I'm searching for, then it opens the
Paraform for me to input again what I'm searching for.
Did I miss something in the code instruction?
Thanks,
TraceyDee
I would like to have a search option in my form to search *, in a field
or group of fields.
---------------------------------------------------------------------------------------------------------------------------------------------
From: Fredg - view profile
Date: Wed, Oct 16 2002 8:31 am
Email: "Fredg" <[email protected]>
Groups: comp.databases.ms-access
Not yet ratedRating:
show options
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse | Find messages by this author
Chris,
Make a new Query, based upon whatever table(s) you require to get the
data
you need.
On the Field to be searched's Criteria line, write:
Like "*" & forms!ParamForm!SearchFor & "*"
Make a new Form, using the query as Record Source.
Code the Form's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog
Code the Form's Close event:
DoCmd.Close acForm, "ParamForm"
Next, make a new Form.
Add a text control for each different field of data you wish to search
for.
(I'm going to use just one here.)
Name it SearchFor.
Add a Command Button.
Code the button's Click event:
Me.Visible = False
Name this form ParamForm.
When you are ready to search your database, open the first form.
It will open the ParamForm.
Enter the search word or phrase.
Click the Command Button.
The form will show all records that contain that word/phrase anywhere
in the
appropriate field.
When you close the form, the ParamForm will also close.