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

How to search for a record??

Status
Not open for further replies.

springy2003

Instructor
Jan 30, 2003
67
GB
Hi, I want to know how to search in a form to find a record that I want. For example, if I have a table called tblmembers and the fields are autonumber, name for example. In a form, these are also a field, and I want a button that when I press I enter a search critea like find record number 3 or find any names which has the same forename for example. Do you use a query for this?? I tried using the find record command button but it doesn't work. It says it can't find anything. Can someone please help me.

Richard Tan
 
Hey it is me again. What I am trying to do is see the record navigation at the bottom of a form, take that out and create my own one in the actual form so it is customised to what I want...
 
Richard,

The find button should work but it is normally associated with searching on a single field.

A query is a better solution if you wish to have multiple criteria.

The steps would be:

Create a new query that will show you the values from the table you wish to use.

Set the criteria for the field in the query so it uses the form field as it's reference. For example to search on the LastName field the criteria would be Like Form![Myform].[LastName]

Finally, you would set up a button on your form to open the query.


HTH,

Steve

 
hmm... understand building the query and I know how to set a button to open the query, but I don't understand where you said

"Set the criteria for the field in the query so it uses the form field as it's reference. For example to search on the LastName field the criteria would be Like Form![Myform].[LastName]"

Sorry, but I am new to Access and I have not used it a lot.

Richard
 
At the moment, I have set the criteria so that it searches a diffinate value, eg on auto number search 2, but how can I varry this?
 
Wish I could edit my post, because I have another question. How to view the results that you get in the same form that you have designed. So far, it is only viewed in a data sheet from the query, but I would liek it in the form. Do you use some kind of filter????
 
I have done the

Set the criteria for the field in the query so it uses the form field as it's reference. For example to search on the LastName field the criteria would be Like Form![Myform].[LastName]

thing now, I understand that, but is there anyway in which I can view it in my form?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top