Subform question

aziz rasul

Active member
Local time
Today, 20:01
Joined
Jun 26, 2000
Messages
1,935
I have a subform in datasheet view and a check box in the main form.

What I want to do is that if the check box is unticked, I want one of the fields in the subform to become invisible and vice versa.

This is the code so far:-

If Me!Medics = True Then
Me![COURSE INFORMATION]![Attended 1st Day].Visible = True
Else
Me![COURSE INFORMATION]![Attended 1st Day].Visible = False
End If

What am I doing wrong?
 
Hi Aziz,

You need to reference the control in full:

Forms!frmMyForm!frmMySubform.Form!myControl.Visible = False

HTH
Rob
 
I have amended the code to suit, but it has no effect. Is it due to the fact that the subform is in datasheet view. In other words the code

Forms!frmMyForm!frmMySubform.Form!myControl.Visible = False

for myControl to become invisible has to have the subform in FORM VIEW?
 
Hi Aziz,

I apologize, I think I was half asleep when I read your post :o

I think you are correct in that because your subform is in datasheet view you can't hide a field. Have you tried it in another view like continuos forms to see if it works?
 

Users who are viewing this thread

Back
Top Bottom