GoTo a Record using an OnClick Event

ddrew

seasoned user
Local time
Today, 11:44
Joined
Jan 26, 2003
Messages
911
I have a number of buttons on a form numbered A1, B1 C1, etc, I have a text box called Sim that links the main form to a subform with lots of info on it. I want to be able to click on btn_A1 and for the record A1 to display. Can someone heclp please?
 
You mentioned a Form with several buttons A1, B1.... You want to click button btn_a1
and have record A1 display.

Is button A1 really btn_A1?
Where is record A1-- in a Table or query?
Where exactly did you want record A1 to display?
 
As jdraw has suggested, your post is somewhat lacking n details, but having a separate button for each record can, over time, become problematical. What if your needs change and the number of records increase? You could easily run out of real estate for all the needed buttons.

The pretty standard way of doing this involves using a native function of a Combobox.

You've apparently already created a form (with subform) based on your table or query, including all the fields you want displayed. Now simply:

  1. Add a Combobox to your form.
  2. The Combobox Wizard will pop up
  3. Select "Find a record based on the value I selected in my combobox."
  4. From the table or query the form is based on, click on the field you're searching by (a field that is unique for each record) to move it to the right side.
  5. Hit Next.
  6. Size the Column appropriately.
  7. Hit Next.
  8. Name the Combobox.
  9. Hit Finish.
Now you can drop the Combobox down and scroll down to the item to search by, or you can start to enter the item, and the Combobox will "autofill" as you type. Hit <Enter> and the record will be retrieved.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom