PDA

View Full Version : Solved: Trying to group a set of Controls into a Frame for Access 2007



scott56
02-14-2009, 01:04 AM
Hi,
I am using Access 2007 for this first time and I am trying to group a set of controls (textbox, combo and listbox)....so that I can then enable that frame or disable it in one statement.

I was able to do this in Excel forms, but I cannot seem to get the Frame control to recognise the controls within it...the frame.enable works for the frame but not the controls in it...

Any suggestions would be appreciated.

Thanks
Scott

ibgreat
02-14-2009, 08:18 AM
Scott,

I don't believe you can setup an option group ("frame") this way. You have to create the option group first then the controls within it. Someone more familiar with Access may know differently.

More importantly, I think you are misunderstanding the option group object. The purpose of this within Access is to show the user multiple selections, where only one option can be selected at a given time. Therefore, all the object within the frame would be of the same type (i.e., option button OR checkbox, not both).

The easiest way I know of to get all the controls to become visible or not visible at one time is to create subprocedures that do this. Then you can use a single Call statment where ever you need it.

Enjoy.

scott56
02-14-2009, 01:13 PM
I had thought the Frame control as it operates in Excel (which is not just a place to group Option checkboxes) would be the same in Access....but it appears not..

I will try the suggestion as this is the long way round but will work

Thanks for the input

Scott

hansup
02-17-2009, 07:01 AM
Hi,
I am using Access 2007 for this first time and I am trying to group a set of controls (textbox, combo and listbox)....so that I can then enable that frame or disable it in one statement.

I was able to do this in Excel forms, but I cannot seem to get the Frame control to recognise the controls within it...the frame.enable works for the frame but not the controls in it...

Any suggestions would be appreciated.

Thanks
Scott
You could move the set of controls to a subform. Then, from the "parent" form, you could enable/disable them in one operation.

'(subform is named frmSub1)
Me.frmSub1.Enabled = False 'disable
Me.frmSub1.Enabled = True 'enable
Maybe that seems crude, but I think it does what you're asking for.

scott56
02-17-2009, 01:03 PM
Yes, you are right that approach would achieve what I am after. I have not yet used the subform control...but will try it now

Scott


You could move the set of controls to a subform. Then, from the "parent" form, you could enable/disable them in one operation.

'(subform is named frmSub1)
Me.frmSub1.Enabled = False 'disable
Me.frmSub1.Enabled = True 'enable
Maybe that seems crude, but I think it does what you're asking for.

CreganTur
02-17-2009, 01:46 PM
One thing to consider when working with subforms:

If any controls or code on your main form refer to controls on your subform, then you will have to drill down an extra layer to reach the control. Instead of Me.Textbox, you'll have Me.Subform.Textbox.

This can cause some major headaches if you aren't aware of it!

HTH:thumb