![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Thanks for responding, Tony! What is the code for getting the list of the controls once you have the form open in design view? You can't use: For each Ctl In Forms("MyForm").Controls because the Forms collection doesn't exist when no forms are open. |
|
Further, If whatever you know works for MDBs, does it work for ACCDBs? |
#12
| |||
| |||
|
|
You open the form in design view. However that only works for MDBs. |
#13
| |||
| |||
|
|
Thinking through this, I wonder if anyone has a position on whether opening the form in data entry mode might not be just as easy as design mode? What advantage would there be in using design view? No locking? |
#14
| |||
| |||
|
|
On Sat, 11 Oct 2008 17:52:16 -0400, "Steve" <nonsense (AT) nomsense (DOT) com> wrote: What is the code to create a list of the controls on a closed form in the current database? Thanks! Steve Depending on your version of Access, see the documentation on the AllForms collection in VBA help. |
#15
| |||
| |||
|
|
Depending on your version of Access, see the documentation on the AllForms collection in VBA help. But an AccessObject does not have a Controls collection. For this purpose AllForms is no more useful than Containers!Forms.Documents. |
#16
| |||
| |||
|
|
A lot of this depends on why he is wants the control list. My assumption is that he needs it for some of his own development requirements whatever they might be. Therefore opening it in Edit mode saves some errors that might occur if the form was opened in regular mode. Did you mean to say "opening it in Design View"? |
#17
| |||
| |||
|
|
"David W. Fenton" <XXXuse... (AT) dfenton (DOT) com.invalid> wrote: A lot of this depends on why he is wants the control list. * My assumption is that he needs it for some of his own development requirements whatever they might be. Therefore opening it in Edit mode saves some errors that might occur if the form was opened in regular mode. Did you mean to say "opening it in Design View"? You are correct. Tony -- Tony Toews, Microsoft Access MVP * *Please respond only in the newsgroups so that others can read the entire thread of messages. * *Microsoft Access Links, Hints, Tips & Accounting Systems athttp://www.granite.ab.ca/accsmstr.htm * *Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/ |
#18
| |||
| |||
|
|
"David W. Fenton" <XXXusenet (AT) dfenton (DOT) com.invalid> wrote: A lot of this depends on why he is wants the control list. My assumption is that he needs it for some of his own development requirements whatever they might be. Therefore opening it in Edit mode saves some errors that might occur if the form was opened in regular mode. Did you mean to say "opening it in Design View"? You are correct. |
#19
| |||
| |||
|
|
Marshall Barton wrote If the list of controls is for a prespecified form and the form's HasModule property is true, then he could use: Dim ctl As Control For Each ctl In Form_myform Debug.Print ctl.Name Next ctl Doesn't that open the form? |
![]() |
| Thread Tools | |
| Display Modes | |
| |