Subform based on the selection of 2 related comboboxes (1 Viewer)

doobybug1

Registered User.
Local time
Today, 06:57
Joined
May 22, 2012
Messages
36
I have 3 tables.

tbl_Notary

RefNo
Name
Surname

tbl_Volumes

VolID
RefNo
Volume

tbl_Contracts

ContractID
Date
Folios
ContractTypeID
Party1ID
Party2ID
VolumeID

tbl_Notary has a 1 to many relationship with tbl_Volumes with the ID RefNo. tbl_Volumes has a 1 to many relationship with tbl_Contracts with VolumeID

I have created 2 comboboxes on the frm_Main. cmb_Notary selects the Notary, cmb_Volume selects the Volume related to that Notary.

I want that after these 2 comboxes have been selected, a subform shows the contact details related to that volume of that notary. So far I have created a sfrm_Contract and afterUpdate for cmb_Volume I inserted the following code:

Code:
Private Sub cmb_Volume_AfterUpdate()

    [Forms]![frm_Main]![sfrm_Contract].Form.Filter = "[VolumeID] = " & Me.cmb_Volume

End Sub

The sub form is not showing the related contracts. Any Idea what I am doing wrong please?
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:57
Joined
May 7, 2009
Messages
19,245
you can just create a Master/Child Link Fields on the subform (on design view).
Link it it like this:

Link Master Fields: [cmb_Volume]
LInk Child Fields: [VolumeID]
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:57
Joined
May 7, 2009
Messages
19,245
see this demo.
 

Attachments

  • NotaryPublic.accdb
    556 KB · Views: 72

Users who are viewing this thread

Top Bottom