Z
zack
Being fairly new to database design, I would be grateful for any advice
or help.
I want the result of 2 queries to appear in a form, however because of
the large amount of information that needs to be viewed I have used
Access's wizard to produce a main form with a linked subform. This
form also produces a command button in the header that toggles to the
subform when you run the query.
The issue is that this command button doesn't always work. When I
first open the application I am prompted by a parameter query to enter
a course leaflet number.
This opens the main form with all the relevant text boxes populated.
However when I click on the command button to the subform, nothing
happens.
If I swop to design view and go into the properties of the button and
simply look at the code behind the on click event, and then go back to
form view the button now works correctly.
It continues to work until I exit the application and re-open it the
problem starts again.
Below is the code that the wizrd produced when creating the linked
form.
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![frmExtraInfoSub].DataEntry = True
Else
Forms![frmExtraInfoSub].Filter = "[LeafletID] = " &
Me![LEAFLET]
Forms![frmExtraInfoSub].FilterOn = True
End If
End Sub
Private Sub OpenChildForm()
DoCmd.OpenForm "frmExtraInfoSub"
If Not Me![ToggleLink] Then Me![ToggleLink] = True
End Sub
I know very little about VB so this doesn't mean much to me yet!!!!
Any help or advice as usual would be greatly appreciated.
Zack
or help.
I want the result of 2 queries to appear in a form, however because of
the large amount of information that needs to be viewed I have used
Access's wizard to produce a main form with a linked subform. This
form also produces a command button in the header that toggles to the
subform when you run the query.
The issue is that this command button doesn't always work. When I
first open the application I am prompted by a parameter query to enter
a course leaflet number.
This opens the main form with all the relevant text boxes populated.
However when I click on the command button to the subform, nothing
happens.
If I swop to design view and go into the properties of the button and
simply look at the code behind the on click event, and then go back to
form view the button now works correctly.
It continues to work until I exit the application and re-open it the
problem starts again.
Below is the code that the wizrd produced when creating the linked
form.
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![frmExtraInfoSub].DataEntry = True
Else
Forms![frmExtraInfoSub].Filter = "[LeafletID] = " &
Me![LEAFLET]
Forms![frmExtraInfoSub].FilterOn = True
End If
End Sub
Private Sub OpenChildForm()
DoCmd.OpenForm "frmExtraInfoSub"
If Not Me![ToggleLink] Then Me![ToggleLink] = True
End Sub
I know very little about VB so this doesn't mean much to me yet!!!!
Any help or advice as usual would be greatly appreciated.
Zack