E
el zorro
I'm trying to optimize my VBA by refering to a form field
using "Me" and the field name instead of including the
path beginning with "Forms," but I can't seem to get it
to work. (The form is opened from another form, from
which the user has selected a doctor. The new form opens
to the appropriate doctor) Here's part of the code I have
in the click event that opens the new form:
stLinkCriteria = "[nDoc]=" & Me![nDoctor]
'Open form to selected doctor
DoCmd.OpenForm stDocName, , , stLinkCriteria
'Don't allow user to change name of facility
Forms!DoctorsF!DocFacility.Locked = True
THis works fine. But when I try to change that last line
to something like this:
Me!DocFacility.Locked = True, or Me.DocFacility.Locked =
True, it doesn't work. ANy idea where I'm going wrong?
THanks!
using "Me" and the field name instead of including the
path beginning with "Forms," but I can't seem to get it
to work. (The form is opened from another form, from
which the user has selected a doctor. The new form opens
to the appropriate doctor) Here's part of the code I have
in the click event that opens the new form:
stLinkCriteria = "[nDoc]=" & Me![nDoctor]
'Open form to selected doctor
DoCmd.OpenForm stDocName, , , stLinkCriteria
'Don't allow user to change name of facility
Forms!DoctorsF!DocFacility.Locked = True
THis works fine. But when I try to change that last line
to something like this:
Me!DocFacility.Locked = True, or Me.DocFacility.Locked =
True, it doesn't work. ANy idea where I'm going wrong?
THanks!