blocking form field

  • Thread starter Thread starter Kay
  • Start date Start date
K

Kay

Hi,
I want to block fields in a subform that ask about a 2nd
or 3rd instructor if there was only 1 instructor for the
class.

Right now, in the subform, I have

Private Sub Form_Current()
if IsNull(mainForm.instructor2) then
form.frame185.enabled=false
else form.frame185.enabled=true
end if
end sub

I keep getting runtime error 424, object expected.

Note, A class is selected from a listbox in the main
form and then the subform is synchronized to store and
retrieve info for the class.

Any suggestions?

Thanks
 
Hi Kay

Is the control called 'Instructor2' on your main form? if so then change
the code to;

Private Sub Form_Current()

If IsNull(Me.Parent.Instructor2) Then
Me.frame185.Enabled = False
Else
Me.frame185.Enabled = True
End If
End Sub

HTH

Andy
 
Back
Top