Trying to create a subform

alphadawg

New member
Local time
Today, 00:13
Joined
Dec 18, 2012
Messages
7
Hi everyone, I was hoping I could get some help

I am making a database to organise trips.
I have a trip form, where the user can add the overall details of the trip. This includes selecting an Organising Company, an Insurance Company, and an Accommodation through the use of combo boxes. When they add the trip, these are saved in the trip table through the use of Organisation_ID. For example, under organising_company could be 3 and under insurance_company could be 7.

So now I want to create a subform which shows the organisations that are associated with the trip, and I assume the only way to do this is to pull the organisation IDs from the trip table ... however I have had no luck trying to do this so far.

If anyone could help point in me in the right direction towards creating this sub form, that would be great, thank you
 
I had a similar issue where I wanted to show the persons in charge for an inspection of a construction site.
Therefore, I created a tabular form with the fields ID and name of the persons and deleted the field ID in the form afterwards, so the form was still linked to the field ID but it was not visible, only the name was.

In the main form which included the ID of the construction site, I created a button that should open the subform and told it to only show persons associated to this construction site using the filter

Code:
Private Sub responsible_Click()
On Error GoTo Err_responsible_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "ResponsibleIDConsultFilter"
    
    stLinkCriteria = "[Consult]=" & Me![ID]               'ID of construction site -> only show persons associated with this ID
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_responsible_Click:
    Exit Sub

Err_responsible_Click:
    MsgBox Err.Description
    Resume Exit_responsible_Click
    
End Sub
 

Users who are viewing this thread

Back
Top Bottom