blocking form field

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
 
A

Andy Cole

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
 

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