Selection determines form layout

  • Thread starter Thread starter amber
  • Start date Start date
A

amber

I want to have two check boxes on a form to show how
billing is sent: single payment or quarterly. I'd like
for the user to be able to check the appropriate box which
would then present the appropriate box or boxes. Is this
possible without a lot of coding? Can I use a combo box
for this?


Thanks!
 
I would start by using an option group on the form because this is an
either/or situation(either Single Payment or Quarterly). Then for the
afterupdate event of the option group frame use something like:

Me.MyControl.Visible = (Me.Frame1 = 2)

This assumes you named your option group frame Frame1 and the Quarterly
option value = 2 which you can check by viewing its properties. If not
change code accordingly.
Also, set the visible property of the control you want to hide initialy to
No.

If you want to use the check boxes then something like this in the after
update of the check box should work

Me.MyControl.Visible = (Me.MyCheckBox)

When you click the check box then MyCheckBox = True which means the visible
property of your control = True.

Hope this helps!!
 
Thanks, Reggie. I tried your suggestion and am getting an
error message that Access can't find a macro called Me.
I'm running Access 2000 and from my QUE book it seems like
your suggestion should work. Any advice?


Thanks,
amber
 
Amber, Don't type this in the properties window next to the AfterUpdate
event. Instead click the ellipsis(...) to the right which will open up the
VBA code window. Here's where you type it in between the Private Sub and
End Sub lines

Private Sub Frame1_AfterUpdate()
Me.MyControl.Visible = (Me.Frame1 = 2)
End Sub
 
Back
Top