Opening a form based on User selection

G

Guest

I have a combo box that takes values from the TableNames table. Each table
has an associated input/search form. I'd like to be able to open the input
form for a given table based on table name selected from the combo box.

I don't have any clue what the combo box attribute is that is set when the
user selects something from the pull down list, and I don't know when the
action should be executed.

Any help gratefully appreciated.
Thanks
Chris
 
G

Guest

It can be done with custom code for which I will guess others here have done
before and will share with you.

Within the core of Access feature set though the Combo box is not a form
opening device - - - -and so another approach would be to simply list those
table names in a form (rather than use a pull down) and put a radio button
selector next to each......so that when selected it triggers the appropriate
form to open. Using the radio button will wizard you thru the link to the
form very easily.

Not the answer you are looking for but maybe a work-around in case you need
it...
 
S

Steve Schapel

Chris,

Assuming your form has the same name as the table it is bound to, you
can do it with an OpenForm action in a macro. In the Form Name
argument of the OpenForm action, put this...
=[NameOfYourCombobox]
Put the macro on the After Update event property of the combobox.
 
G

Guest

Thanks very much, Steve, I'll give that a try!
Chris

Steve Schapel said:
Chris,

Assuming your form has the same name as the table it is bound to, you
can do it with an OpenForm action in a macro. In the Form Name
argument of the OpenForm action, put this...
=[NameOfYourCombobox]
Put the macro on the After Update event property of the combobox.

--
Steve Schapel, Microsoft Access MVP

I have a combo box that takes values from the TableNames table. Each table
has an associated input/search form. I'd like to be able to open the input
form for a given table based on table name selected from the combo box.

I don't have any clue what the combo box attribute is that is set when the
user selects something from the pull down list, and I don't know when the
action should be executed.

Any help gratefully appreciated.
Thanks
Chris
 
G

Guest

Thanks, NetworkTrade, that was the workaround I was considering but was
looking for something a little more elegant :^).

Thanks very much for your help!
Chris
 
G

Guest

SSchapel-

I too am trying to open a form based on a user's selection from another
form. It goes a little something like this:

Employee Selection Form:
[FF-SelectEmployee].[EmployeeSelection]
Data.Row Source:
SELECT [T-Contacts].FName, [T-Contacts].LName, [T-Contacts].ContactID
FROM [T-Contacts]
WHERE ((([T-Contacts].ContactType)="Employee")) ORDER BY
[T-Contacts].LName;
Data.Bound Column: 3 (ContactID)
Event.After Update:
M-SelectEmployee (macro)

Macro:
M-SelectEmployee
Action.OpenForm
Form Name: F-Contacts
Where Condition:
[T-Contacts].[ContactID]=[Forms]![FF-SelectEmployee]![ContactID]
Action.Close: FF-SelectEmployee
Action.SelectObject: F-Contacts
Action.StopMacro

Record Display Form:
F-Contacts
Data.Record Source: T-Contacts
.[FName]
.[LName]
.[ContactID]....

So

I am trying to search on "ContactID." This field is represented on my
criteria dropdown list, my display form, and, of course, in my table.

What am i doing wrong?

Thanks muchly
amelia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top