Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I create a control during run time?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello, everyone

I want to create a label or a text box during run time, not design time. I appreciate any response.

P.S. Visual Basic allow user to create control arrays during run time. But I couldn't find this option in Microsoft Access
 
I am not sure if you could do it at run-time, but couldn't you create it at design time and make invisible until needed?

I will try to look in my books and see about run-time.

Hope this helps... [sig]<p>Terry M. Hoey<br><a href=mailto:th3856@txmail.sbc.com>th3856@txmail.sbc.com</a><br><a href= > </a><br>Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?[/sig]
 
I don't think it can be done at runtime, but (there's always a but)..... although I haven't done it I believe you might do the following:-


1, Turn the screen updating off &quot;docmd.echo false&quot;
This stops the screen showing any updates (probably best done when you know everything works).

2, Open the form in design view.

3, Add the new control and set its properties.

4, Change the form to Form View

5, turn the screen updating back on &quot;docmd.echo true&quot;

(You may need to refresh the form).

This isn't very elegent though and I think you would be better off taking the advice given by 'th3856'



[sig][/sig]
 
Thanks Terry and Kirk

I did what you guys suggested. But it worked for only one control. What if I want two, three, or more controls at run time, I have to create those controls invisibly. I used to did that with Visual Basic, but I think there's no way to do this with Microsoft Access.

Thank you for your response.
 
Thanks Terry and Kirk

I did what you guys suggested. But it worked for only one control. What if I want two, three, or more controls at run time, I have to create those controls invisibly? I used to did that with Visual Basic, but I think there's no way to do this with Microsoft Access.

Thank you for your response.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top