How to link multiple forms to a single form

cesarced 1 Reputation point
2021-05-22T03:57:48.403+00:00

i've posted this same issue on this website www.accessforums.net/showthread.php?t=83680

I want to link 6 forms to a single form
calling an especific form with a button based on an option selected on a combobox with this code

Private Sub Command4_Click()
Dim strForm As String

If Me.TipodeTramite = "Licencia Nueva" Then
strForm = "Req1"
ElseIf Me.TipodeTramite = "Cambio de Domicilio" Then
strForm = "Req2"
Else
strForm = "Req3"
End If

DoCmd.OpenForm strForm
End Sub

but when i add data to one of those forms it creates a new record on my table instead of putting it in the same record as my principal form
i use 2 related tables, my "primary" table stores data like "name, number of document... etc"
and the second (called requisitos) stores some requirements for those records
the form called "Datos de Empresa" displays and record data to my primary table
the forms "Req1,2,3,4,5,6" displays and record some fields from requisitos table
for example Req1 have 3 fields of the requisitos table and Req2 have another 5 fields from requisitos and so on

what can i do to link those 6 forms to my principal form?

Access Development
Access Development
Access: A family of Microsoft relational database management systems designed for ease of use.Development: The process of researching, productizing, and refining new or existing technologies.
799 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. DBG 2,311 Reputation points
    2021-05-22T05:10:03.173+00:00

    Without seeing your db, it's hard to say why. Can you share a sample copy of your db?


  2. DBG 2,311 Reputation points
    2021-05-22T17:29:46.85+00:00

    Hi. Gracias. What is the purpose of your database? We'll need a little background to offer an appropriate advice.