"Go to record" button

  • Thread starter Thread starter Snoopsmom
  • Start date Start date
S

Snoopsmom

I made a staff list form patterned after the Northwinds
database "Customer Phone List" in which you can click an
alpha button to bring up a list of those staff members
(showing last name, first name, and social security number
fields) whose last name begins with that letter. What I
would like to be able to do is to put the cursor on a
particular name (row) then click a command button which
would take me to that person's record on the Employee
Profile form.

Is this possible? I put a command button which ran a
macro to open the Employee Profile form and set
the "Where" condition as the social security number. What
it does is brings me to a blank record. Any suggestions?
 
Hi,

I have exactly this type of setup for a vendor list.

My personal suggestion is to avoid using a macro.
I put a small command button sized to fit just perfect on the far left side of the Detail
area. Clicking on that button will open a vendor form that only displays that vendor. I
believe this is what you want.

To set this up the command button wizard can do all the work for you!
Here's an example using the Northwind database:

1. Make a copy of Northwind and open the copy.
2. Open the Customer Phone List form in Design View.
3. Make sure the wizards are turned on and select the command button option.
4. Place the command button in the Detail area.
5. On the first wizard screen select "Form Operations" from the left box and "Open Form"
from the right box. Hit Next when complete.
6. Select the Customers form from the second Wizard screen. Hit Next when complete.
7. On the third wizard screen choose the option that says "Open the form and find specific
data to display." Hit Next when complete.
8. On the fourth wizard screen select "Company Name" from BOTH list boxes. This will serve
as our *linking* field. Hit Next when complete.
9. On the fifth screen it's up to you if you want text or a picture on the command button.
Hit Next when complete.
10. Last screen name the command button cmdOpenCustomerForm. Then hit Finish.
11. Resize the command button and position it in the far left side of the Detail area.
12. Close and save the form.
13. Open the form in normal mode and click on any button in the Detail area. You will
notice the Customers form opens up only showing the selected Customer.

You should be able to basically do the same thing for your situation except selecting the
correct form and linking fields. The wizard will write all the code for you. You can
always go into the code window and see how it created the filter criteria.

Hope that helps,
Jeff Conrad
Access Junkie
Bend, Oregon
 
Snoopsmom said:
I made a staff list form patterned after the Northwinds
database "Customer Phone List" in which you can click an
alpha button to bring up a list of those staff members
(showing last name, first name, and social security number
fields) whose last name begins with that letter. What I
would like to be able to do is to put the cursor on a
particular name (row) then click a command button which
would take me to that person's record on the Employee
Profile form.

Is this possible? I put a command button which ran a
macro to open the Employee Profile form and set
the "Where" condition as the social security number. What
it does is brings me to a blank record. Any suggestions?
The listbox wizard will guide you through moving to a record based on the
value selected.
If you have the profile form as a subform then setting the master child
relationship will do the same.
There is no need for buttons.
 
Jeff...it worked like a charm! thanks!
-----Original Message-----
Hi,

I have exactly this type of setup for a vendor list.

My personal suggestion is to avoid using a macro.
I put a small command button sized to fit just perfect on
the far left side of the Detail
area. Clicking on that button will open a vendor form
that only displays that vendor. I
believe this is what you want.

To set this up the command button wizard can do all the work for you!
Here's an example using the Northwind database:

1. Make a copy of Northwind and open the copy.
2. Open the Customer Phone List form in Design View.
3. Make sure the wizards are turned on and select the command button option.
4. Place the command button in the Detail area.
5. On the first wizard screen select "Form Operations"
from the left box and "Open Form"
from the right box. Hit Next when complete.
6. Select the Customers form from the second Wizard
screen. Hit Next when complete.
7. On the third wizard screen choose the option that
says "Open the form and find specific
data to display." Hit Next when complete.
8. On the fourth wizard screen select "Company Name" from
BOTH list boxes. This will serve
as our *linking* field. Hit Next when complete.
9. On the fifth screen it's up to you if you want text or
a picture on the command button.
Hit Next when complete.
10. Last screen name the command button
cmdOpenCustomerForm. Then hit Finish.
11. Resize the command button and position it in the far left side of the Detail area.
12. Close and save the form.
13. Open the form in normal mode and click on any button in the Detail area. You will
notice the Customers form opens up only showing the selected Customer.

You should be able to basically do the same thing for
your situation except selecting the
correct form and linking fields. The wizard will write all the code for you. You can
always go into the code window and see how it created the filter criteria.

Hope that helps,
Jeff Conrad
Access Junkie
Bend, Oregon

"Snoopsmom" <[email protected]> wrote
in message news:1424901c4136f$7978
 
Back
Top