Grayed Out Subform

M

Mr. Smiley

Is it possible to make a subform be "grayed out" until the user enters
information in a specific field on the main form? I have a frm_Orders (which
is the main form) and a frm_OrderDetails (which is the subform). I don't
want the user to be able to enter information into frm_OrderDetails without
entering required information in frm_Orders first. Thanks.
 
D

Douglas J Steele

You should be able to set the Enabled property of the control that holds
subform to False:

Me!MySubForm.Enabled = False
 
M

Mr. Smiley

Mr. Steele, I am a novice in access, so please excuse the ignorance of this
question. Do I simply copy your line of code and paste it somewhere, or do I
create a procedure in VB? Thanks.
 
D

Douglas J. Steele

Yes, it's VBA.

That would be a line of code in the form's Load event (or, depending on the
nature of the form, in its Current event)

You'd also need another line of code somewhere where you can determine
whether whatever action(s) has/have been completed so that you want the box
enabled:

Me!MySubForm.Enabled = True
 
Top