Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking Unbound Forms or List boxes

Status
Not open for further replies.

spartansFC

Programmer
Apr 1, 2009
165
GB
Hi

I have a single table (tblParentChild) which has the following fields

lngParentChildID
lngFamilyID
lngParentChildType
strParentChildSurname
strParentChildForename....etc

lngParentChildtype is a combo box on a form which allows the user to select if the entry is "Main Parent", "Child", or "Other".

I've created 3 queries for each unbound box, the lngParentChildType has a criteria in each query which will only display the relevant people

1 = Main Parent
2 = child
3 = other

So i want the main unbound form "frmMainParent" to show all main parents and when the user clicks on each main parent, the other 2 unbound forms update to show only the other people who are part of that family in frmChildren and frmFamilyOther.

I think i've got my tables created in the right way, i.e i only need the one table to show the members of each family, it's just i'm a bit stuck as to how to split and link them into their 3 unbound forms.

Ive attached a picture of tblParentChild to show how the data is stored.

Any ideas.

Mikie

tblparentchild.jpg
 
Why do you feel it necessary to use UNBOUND forms?

(RG for short) aka Allan Bunch MS Access MVP acXP ac07 ac10 winXP Pro Win7 Pro
Please respond to this forum so all may benefit
 
Yeah, what is up with the unbound forms? Link the two bound subforms to the combo box by familyID.
 
Thanks for your replies, i'm not sure why i went for unbound forms, but i've created 2 forms based off the queries and put them on a blank form.

I've managed to sort it, on frmFamilyDetailsSubformMainParent in the OnCurrent event i've got:

Code:
Dim ParentDocName As String

    On Error Resume Next
    ParentDocName = Me.Parent.Name

    If Err <> 0 Then
        GoTo Form_Current_Exit
    Else
        On Error GoTo Form_Current_Err
        'Name of Subform
        Me.Parent![frmFamilyDetailsSubformChildren].Requery
    End If

Form_Current_Exit:
    Exit Sub

Form_Current_Err:
    MsgBox Error$
    Resume Form_Current_Exit

and then on frmFamilyDetailsSubformChildren ive got the 2 forms linked by:

link child fields: lngFamilyID
link master fields: [frmFamilyDetailsSubformMainParent].Form![lngFamilyID]

i had previously tried this but it didn't work thats why i thought i was doing something wrong.

Thanks for the help

Mikie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top