I built a combobox in a main form whose selection would open one of ten secondary forms (not subforms). I need help. I'm using Access 2007. My db is a main child death identification table (TableMain: pk=MAIN_ID) and form (TableMainFrm) with name,DOB, address, etc. The combobox lists 10 (COD)Causes of Death such as (Infant Natural, Child Natural, Homicide, Suicide and 6 others. Each COD has a separate table and form such as InfNatTab (fk=InfNatID) and InfNatFrm, ChdNatTab (fk=ChdNatID) and ChdNatFrm, HomTab (fk=HomID) and HomFrm, etc. This would be just for entering NEW data. The main table combobox AfterUpdate code looks like this:
Private Sub Combo125_AfterUpdate()
Dim strFormName As String
Select Case Me.Combo125.Column(0)
Case "Natural_Infant"
strFormName = "InfNatFrm"
Case "Natural_Child"
strFormName = "ChdNatFrm"
Case "Homicide"
strFormName = "HomFrm"
Case "Suicide"
strFormName = "SuiFrm"
'etc
End Select
DoCmd.OpenForm "strFormName"
End Sub
This works fine but I must insert the same MAIN_ID pk value into its corresponding secondary InfNatID or ChdNatID or other secondary fk when it opens. I figure that I have to do this in order to create a separate data EDIT system consisting of a form based on a query of main & COD tables showing the complete linked main & COD data of each record just for editing.
I also need a button at the end of each COD form that will take user back to a new blank Main form to enter the next new main record.
This is also supposed to be a multi-user data entry system, maybe 3 users. Will Access's db splitter tool be enough or will more code be needed.
As you can see I'm a novice. If you have a better, simpler way, please let me know.