Dim or hide subform until box checked?

G

Guest

I have a form (Add Member) with multiple check boxes (Plumber? Welder? etc).
When I check the box I would like the subform (Plumber Certs, Welder Certs,
etc) to appear or become typeable (I've seen subforms dimmed until a box is
checked).

Can you help me?

If this involves code, specific instructions would be very helpful, as I
have no experience in code writing.

Thanks for your time,

Blair :)
 
G

Guest

Select the check box and go to properties.
Click on the ... bit next to 'after_update' in events. Choose code builder.

include the following...
If me!FieldName = True then
Me!SubFormName.Visible = True
Else
Me!SubFormName.Visible = False
end if

obviously, you'll need to change 'field name' and 'subformname' to whatever
you've called them. If you don't want to hide the subform but just want to
make it unusable, use me!SubFormName.Enabled = True and
Me!SubFormName.Enabled = False instead.

Either way, if the user goes to a new record on the main form, the subform
will stay in it's current setting. To get around this you need to include the
same code again in the 'on current' property of the main form. Select the
main form (click on the square in the top left); bring up the properties
window and select events - you should see on current in there. Include the
same code that you included for after update. (really you should only include
the code once and call it from two separate locations but I'm trying to keep
it simple for you!)
 
G

Guest

Thank you for a speedy reply, Jack.
I'm still having a problem.

-
Private Sub Check36_AfterUpdate()
If Me!Plumber = True Then
Me!MembersSubform.Visible = True
Else
Me!MembersSubform.Visible = False
End If

End Sub

-
When I try to see if it works I get the message:

The LinkMasterFields property setting has produced this error:'Invalid
outside procedure'

I really need to learn to speak computer.

Help? Thanks again.
 

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