Linking forms

Solaron

Registered User.
Local time
Today, 02:39
Joined
Aug 8, 2002
Messages
13
This may be simple, but it's annoying the hell out of me!

I want to be able to have 2 subforms, both in datasheet view, and both linked. But i want it so that when i select a record on one, it will change the subform below it to the relevant records.

Confused? Sorry.

I can do a simple subform in a subform, but that then makes one datasheet with a drop down box for the next datasheet - i want both datasheets viewable at the same time - one below the other.

Cheers guys,

Solaron
 
There are two ways I would consider doing this

1) use a query to populate the second subform and set the linking criteria in the query. Do not set master/child links.
2) Create a Control on the main form named the same as the linking field and make the controlsource
= Forms!MainForm!Subform1.Form!LinkingField
then in the master/child links, add manually (this is important) then name of the linking field to the second subform.

Hope that is clear (as mud probably!)
 
Code:
Sub Form_Current()

    On Error Resume Next
    If Err <> 0 Then
        GoTo Form_Current_Exit
    Else
        On Error GoTo Form_Current_Err
        Me.Parent![frmATL_CHKLST_SUB Subform].Requery
    End If

Form_Current_Exit:
    Exit Sub

Form_Current_Err:
    MsgBox Err.Number & " - " & Err.Description
    Resume Form_Current_Exit

End Sub

This subform is linked via the master/child links to the main form. The subform that this one is controlling has in the Master Links field, a reference to the this subform. So subformA is linked to Mainform. In the Current event of subformA is a requery for subformB. In the master/child links for subformB is a reference to the controlling field in subformA [frmATL_CHKLST_ITEM Subform].Form![ITEM_ID]
 
Cheers guys, i understand what needs doing now - but to be honest, i haven't a clue how to do it! This is my first access database (other than an a-level project), so my knowledge of controls in acess is very limited.

So, how exactly do i make the control on the form?
 

Users who are viewing this thread

Back
Top Bottom