Search only bounded fields

Lourry

Registered User.
Local time
Today, 08:21
Joined
May 19, 2004
Messages
41
Hi All,

I have created a Search button and it has the default code that Access create when I create a search button. Can I modify the code so that whenever a user click that button, it will search for only the bounded fields on the form? For example there are 5 bounded fields, and a user only filled in 2 and click search, the search will find all records satisfying those 2 bounded fields that the user input data into the form. How can I achieve this??

Thanks a lot!
-Lory
 
Lory,

You can make a query that uses the "unbound" fields
in your form as criteria.

=Forms![YourForm]![txtSearchName] or
Forms![YourForm]![txtSearchName] Is Null

Then when you hit your ExecuteQuery button, you can
requery the form and it will use your "unbound"
criteria to retrieve the "bound" data.

Wayne
 
WayneRyan said:
Lory,

You can make a query that uses the "unbound" fields
in your form as criteria.

=Forms![YourForm]![txtSearchName] or
Forms![YourForm]![txtSearchName] Is Null

Then when you hit your ExecuteQuery button, you can
requery the form and it will use your "unbound"
criteria to retrieve the "bound" data.

Wayne

Thanks Wayne, however, I am a beginner in Access. Can you explain further what you mean? I need to do a search on only the bounded fields on the form, becuase the unbounded fields (like the listboxes), after a user choose the value, it will automatically generate a code in another textbox which is a bounded field. So when the user type in a code in the bounded textbox and hit search, it will display the records that has that code.

Please let me know if I am not clear enough!
Many thanks!!

-Lory
 

Users who are viewing this thread

Back
Top Bottom