Combobox to open one of several table forms (1 Viewer)

Zydeceltico

Registered User.
Local time
Yesterday, 21:21
Joined
Dec 5, 2017
Messages
843
Hi All -

I have a junction table called tblInspectionEvents.

It has fields Inspection_ID, DateTime, and InspectionType. I have a form called frmInspectionEvents that is based on tblInspectionEvents.

I have several tables that record data for a different kinds of inspections (e.g., tblWeldTests, tblAssemblyInspections, tblMillInspections, etc.).

On frmInspectionEvents, I would like to have combo box bound to InspectionType. When the user clicks the combo box, I would like to present the user with a drop down containing: "weld test," "assembly inspection," "mill inspection," etc.

When the user makes a selection I would like an inspection form open that is based and bound to the corresponding table. For instance, if the user were to select "weld test" from the dropdown menu, frmWeldTest would open for data entry. When the user saves the new data in frmWeldTest a record would be created in both tblWeldTest and also in tblInspectionEvent.

Is this possible?

Thanks,

Tim
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 18:21
Joined
Aug 30, 2003
Messages
36,124
Sure. Add a hidden column to the combo with the actual form name, then:

DoCmd.OpenForm Me.ComboName

adding a column reference if the actual name isn't the bound column (which I'd make it).
 

Zydeceltico

Registered User.
Local time
Yesterday, 21:21
Joined
Dec 5, 2017
Messages
843
Sure. Add a hidden column to the combo with the actual form name, then:

DoCmd.OpenForm Me.ComboName

adding a column reference if the actual name isn't the bound column (which I'd make it).

Right now my cbo IS bound to field InspectionType in tblInspectionEvents. So - just to clarify for my noob self - once a given Inspection form is filled and the user clicks "Save" on the inspection form and given that the original cbo is bound to tblInspectionEvents, a new record will be created in tblInspectionEvents *at that time*? I don't want to end up with a bunch of empty records from new blank records being recorded to tblInspectionEvents if the user doesn't complete the inspection in the form called from the cbo.
 

Users who are viewing this thread

Top Bottom