tags:

views:

1236

answers:

6

I'm trying to link a field, which I have a drop down box in, to a form. I have a list of about 10 forms to pick from. I'm sure this is simple, but I'm just overlooking the obvious.

A: 

Let me understand this right, you have a form with a combo box. When the user selects an option from the combo box, one of 10 other forms open?

How about, in the On Change Of event of the combobox, open the second form?

PowerUser
+1  A: 

Simple example code for the opening from the EventName() event (change EventName based on what event you are using):

Private Sub Combo0_EventName()
    If Combo0.Value = "Form1" Then
        DoCmd.OpenForm "Form1", , , acFormAdd, , , stLinkCriteria
    ElseIf Combo0.Value = "Form2" Then
        DoCmd.OpenForm "Form2", , , acFormAdd, , , stLinkCriteria
    End If
End Sub

Depending on what you are trying to do will determine the event to use, but running the open form command in that event based on the combo box value will get you where you need to go.

amarcy
A: 

I have a field with a drop down box that has about 10 items in it. According to the drop down box answer i want it to pick a form to add and fill in the form automatically. Im just a beginner with access.

Can you make this a comment on the question or an edit to the question instead of an answer?
Jeff O
A: 

To clarify:

You open up Access and are presented with a form that contains a combo box filled with some values. You select one of the values and want to bring up a different form and then fill that form out based on some criteria.

The sub routine Combo0_EventName() will take care of opening a form based on the field you select, just put the code in the Combo0_AfterUpdate() routine. To get to that right click on the combo box in design view and select Properties, then click in the "AfterUpdate" event to get [Event Procedure] to show up then click the ... button to get the VB editor.

If you want to fill out the form you open up automatically the method depends on what you are trying to do. You probably want to have another combo box on the first form or on the other forms you are opening that allows you to select your query parameters. Lets say you are opening a form that displays someone's address. You would want a combo box on that form to select from the names in your table and when you select a name it would update a textbox with the address information. Or you could put your query parameter selection on the main form and tie that data to all of the forms so you can go through the forms with the same entry in the table, useful for something like order entry.

If that sounds like what you are trying to do we can move forward down that path, or if it is not please clarify. Can you describe an example of what you are doing? That would be helpful.

I'm sure we can get you going with this.

amarcy
A: 

Im trying to make local tax forms. We do several different local forms and just want the person perparing the return to be able to put in the basic information in a form, which will then automatically pop up which form they are to use, completely filled in. This way all they have to do is enter the basic info in a standard sheet and the local form automatically gets completed. I have made it so when i person picks the municipality from the drop down box it automatically list the form name it needs to go in. But i want it to be simpler than that for them. NE Suggestions?

A: 

That makes sense, each form probably has different tax codes, addresses, etc. on it.

I'll see what I can do over the next couple days and set you up with something to get you going.

amarcy