subfrom visible/ invisible controlled by checkbox

Joined
Jun 16, 2011
Messages
1
Reaction score
0
Can anyone help?

Im really struggling ( fairly new to programming access!

I want to be able to show a subform depending whether a check box on the main form is checked or not.... I found this codeusing the on current and after update controld but I keep getting a compile error can anyone help?

the subform is called "PSU subform" what am I doing wrong


Private Sub Check8_AfterUpdate()
'After Update of checkbox
'Check if Active checkbox is selected
'then show or hide subform
If Me.Active = True Then
Me.PSU SubForm.Visible = True
Else
Me.PSU SubForm.Visible = False
End If

End Sub
Private Sub Form_Current()
'On current event of main form
'Check if Active checkbox is selected
'then show or hide subform
If Me.Active = True Then
Me.PSU SubForm.Visible = True
Else
Me.PSU SubForm.Visible = False
End If
End Sub
 
Joined
Jul 20, 2011
Messages
16
Reaction score
0
Modify the Code as below:

Code:
Private Sub Check8_AfterUpdate()
'After Update of checkbox
'Check if Active checkbox is selected
'then show or hide subform
If Me.Active = True Then
Me.[PSU SubForm].Form.Visible = True
Else
Me.[PSU SubForm].Form.Visible = False
End If
 
End Sub
Private Sub Form_Current()
'On current event of main form
'Check if Active checkbox is selected
'then show or hide subform
If Me.Active = True Then
Me.[PSU SubForm].Form.Visible = True
Else
Me.[PSU SubForm].Form.Visible = False
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top