A
abdul wahab via AccessMonster.com
i have the following code in one of my forms, but dont know what it means.
pls can anyone give me a clue.
Private Sub ToggleLink_Click()
On Error GoTo ToggleLink_Click_Err
If ChildFormIsOpen() Then
CloseChildForm
Else
OpenChildForm
FilterChildForm
End If
ToggleLink_Click_Exit:
Exit Sub
ToggleLink_Click_Err:
MsgBox Error$
Resume ToggleLink_Click_Exit
End Sub
Private Sub FilterChildForm()
If Me.NewRecord Then
Forms![FrmInvoice].DataEntry = True
Else
Forms![FrmInvoice].Filter = "[Car ID] = " & Me.[Car ID]
Forms![FrmInvoice].FilterOn = True
End If
End Sub
Private Sub OpenChildForm()
DoCmd.OpenForm "FrmInvoice"
If Not Me.[ToggleLink] Then Me![ToggleLink] = True
End Sub
Private Sub CloseChildForm()
DoCmd.Close acForm, "FrmInvoice"
If Me![ToggleLink] Then Me![ToggleLink] = False
End Sub
Private Function ChildFormIsOpen()
ChildFormIsOpen = (SysCmd(acSysCmdGetObjectState, acForm, "FrmInvoice")
And acObjStateOpen) <> False
End Function
pls can anyone give me a clue.
Private Sub ToggleLink_Click()
On Error GoTo ToggleLink_Click_Err
If ChildFormIsOpen() Then
CloseChildForm
Else
OpenChildForm
FilterChildForm
End If
ToggleLink_Click_Exit:
Exit Sub
ToggleLink_Click_Err:
MsgBox Error$
Resume ToggleLink_Click_Exit
End Sub
Private Sub FilterChildForm()
If Me.NewRecord Then
Forms![FrmInvoice].DataEntry = True
Else
Forms![FrmInvoice].Filter = "[Car ID] = " & Me.[Car ID]
Forms![FrmInvoice].FilterOn = True
End If
End Sub
Private Sub OpenChildForm()
DoCmd.OpenForm "FrmInvoice"
If Not Me.[ToggleLink] Then Me![ToggleLink] = True
End Sub
Private Sub CloseChildForm()
DoCmd.Close acForm, "FrmInvoice"
If Me![ToggleLink] Then Me![ToggleLink] = False
End Sub
Private Function ChildFormIsOpen()
ChildFormIsOpen = (SysCmd(acSysCmdGetObjectState, acForm, "FrmInvoice")
And acObjStateOpen) <> False
End Function