JVanKirk
Oct 22 2004, 01:23 PM
Is there a way to have all controls revert to their default state on the click of a button without having to type the name fo each control?
Thanks in advance for the help
J
Candace Tripp
Oct 22 2004, 01:45 PM
CODE
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then
'... do your reset here
End If
Next ctl
JVanKirk
Oct 22 2004, 01:54 PM
I'll elaborate a bit more because I have subforms and labels as well.
I am creating a menubar that looks and acts like an html menu bar. That part is pretty much working OK but I was hoping to be able to cut out some code by setting each control on my form(subforms, labels, unbound textboxes and the like to their default state(whichc the only property I am concerned with is the visible property for each control).
So, when I click on the Taskings button on my menu bar it sets sfrmMyTaskings to visible. What I need to do is when I mouse over my Tickets button and then down to one of the submenu items and click on a button there, I want all controls to go back to their original visible state(and forecolor for the labels that "highlight" when I mouse over the buttons). I can accomplish this by naming every control at the right events but would love to have some way to do it in a few lines of code as opposed to lots of lines.
Candace, I'm honored the Access Queen has gotten involved in one of my posts!!
I have visited your library lots and used a few of your examples to further my Access knowledge.
Thanks,
Jason
ChrisO
Oct 22 2004, 11:32 PM
Jason.
Whether or not Candace is the Access Queen is irrelevant.
My read of Candace’s posts are that they will get you started but are not intended to do all the work for you.
That is something very important.
Please look again at the code supplied by her, it points you in the right direction.
The next thing required is to know where and what code is running.
The next thing to know is where the objects are.
Always…code needs to know under what circumstances it is running…the source.
The destination objects need to be specified either in an absolute or relative fashion.
(Relative is better.)
With 783 posts you are still answering to yourself. Why?
Please drop a demo in A97.
Regards,
Chris.