Drop down list to open a from at a specific record

  • Thread starter Thread starter --J
  • Start date Start date
J

--J

hey All,

I have a small form that has one drop down list on it. I would like to open
a form at the record selected in the drop down list... Eg:

User selects John Smith in drop down on FromA and then FromB opens up at the
revcord for John Smith.

I have the form opening up, but cant get it to go to John Smith. It goes to
the first record. Would I be best to use the after-open command to look at
the data in the combo?

Cheers
-J
 
Check Access VB Help on the arguments of the OpenForm Method.

1. If you want to filter the sencond Form to a single Record (John Smith),
use the "wherecondition" argument.

2. If you don't want to filter to single Record on FormB, use the
"OpenArgs" argument to pass unique value(s) that identify John Smith's
Record and use the Load Event of FormB to navigate to Fohn Smith's Record.
 
Hmmm I see what you are trying to say... But I am a newB at this and do not
follow you exactly!!

Can you please explain a little!! Sorry! :(

I have the drop down running a macro... shoudl I be using some other way.

Cheers
-J
 
You can also base your FormB off a query. On the criteria line of the query,
use the expression builder to point to the corresponding field on your FormA.
Then, if you have an open form on a button, it will open to only those
records. The expression on your criteria line should something like:
Forms![frmFormA]![NameField]

Hope this helps.
 
Sorry guys... I am still up the creek on this one.

What I have is a drop down list that has an event on "AfterUpdate" that
opens FormB. What I need is for FromB to open at a the specific record
selected in the drop down list. I just don't know how to do it!

Cheers
-J
 
Create a Macro using

Macro Action: OpenForm
Form Name: FormB
Where Condition: [RecordID] = Forms!FormA!YourComboBox

[RecordID] is the Field in FormB's RecordSource that corresponds to the
value in the ComboBox.

Save the Macro and assign this Macro to the AfterUpdate Event row of your
ComboBox's Properties window.

Suggest you check out an Access book because this is covered by virtually
every Access book. Newsgroups should be the one of the last resources after
Help on your own Access books since replies will usually take some time.
 
Back
Top