Full Version: Subform Enable/Disable
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
bgrunenb
Hi Guys,

I have a Main form that has an address subform. I have a combo box on the main form that selects address records. I know that normally you should enter the address information in a seperate popup form and then return to the main form, but I was trying to avoid having to use popups by enabling/disabling the controls ont he subform.

The address record is made up of (unit, streetaddress, city, prov, postal)... the combo is tied to streetaddress. I was hoping to:

- in the Open event of the form, disable all the controls on the Address subform (done, easy)
1. in the notinlist event of the combo, enable the controls on the subform ( i think i can make this work)
- add an edit address buton for editing exisiting records (done, easy)
2. when the subform looses focus the controls on the subform are again disabled ( i cant figure out how to do this without coding the GotFocus event of each other control on the form to disable the subform controls... this [censored], hoping to find a better way)

Thanks guys, 1 and 2 are really what I need help on.

Cheers,

BG
fkegley
2. Set the Enabled property of the Subform Control to False. Or, if you prefer, set its Visible property to No. Then some other event can enable the Subform Control or make it Visible.
bgrunenb
Hi Frank,

My major problem with this whole thing is finding an effecient means of makeing the subform DISABLED again once ive made it enabled.

I'd like it to happen once the controls on the subform loose focus... but everything I've tried doesnt work...

How might you suggest I make this work?

Cheers and thanks for your help.,

BG
fkegley
I have attached an example. Instead of disabling enabling the subform, the subform is made visible, not visible. When a customer code is picked from the combo box at the top, the subform is made visible. When the user navigates via the next record button, the subform is made invisible.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.