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

Combo Wizard Find Record

Status
Not open for further replies.

greenter

MIS
Nov 3, 2001
11
US
The combo wizard in my version of Access 97 does not have the "Find a record based on the value I seleted" option. Can someone please give me the code. Thanks.
 
In the AfterUpdate event procedure of the ComboBox paste the following:

' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[SearchField] = '" & Me![ComboName] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark

The ComboBox has two columns with the first being the SearchField and it is the bound column for the ComboBox.

Bob Scriver
 
Thanks! Now the form points to the first record that matches the search field but displays all records. I would like for it to only display the records that match the combo box. How do I do that?
 
I don't understand the kind of form that you are describing. When you say that it displays all records what do you mean? Is the record selected in the combobox the record being displayed in the form objects of your form? Do you mean that you can scroll through your records using the RecordIndicator at the bottom of the form.?

I don't understand the situation. Please be very specific.

Bob Scriver
 
Okay, I'll see if I can explain (I am obviously learning as I go here). I have designed a search form - in this case, a list of contributors for a fundraising campaign. I want to be able to select a name in the combo box and have the form display only that record. What happens now is that all records are displayed and the matching record is indicated by record selector on the side of the form.
Thanks again.
 
It sounds like you have created a form in Data Sheet view. This is a column for each field and a row for each record. There are other types of forms that you can create with the Forms Wizard. It will walk you through creating a form with just one records data showing in individual form textbox objects. On this form you can place a find record button that will perform the function that you asked for earlier. I believe that is what you are looking for.

Click the Forms tab in the database window and click the New button. On the next window select Form Wizard and select the underlying Table or Query that will feed records to the form. Then click OK.

Follow the prompts and the Wizard will assist you in creating a form that will perform as you asked.

Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top