Techwarelabs Community

Techwarelabs Community (https://www.techwarelabs.com/community/index.php)
-   Software - Applications, Programming, and Games (https://www.techwarelabs.com/community/forumdisplay.php?f=13)
-   -   Any Access or VB Experts (https://www.techwarelabs.com/community/showthread.php?t=1047)

Propig 04-26-2002 09:26 AM

Any Access or VB Experts
 
I am able to create and populate controls based on a recordset. But when you open the form in datasheet view the Column headers show as Text0, Text1, etc.

Can I specify the name of the textbox at the time I create it? I would like the name of the textbox be fld.name

Here is my code


   For Each fld In frst.Fields
       
       Set ctlText = CreateControl("frmname", acTextBox, , , fld.Name)

   Next

Yes, I could create labels for the text boxes, but then I have to also place them in the correct spot on the form. Since the fields that are shown on the form can be as few as two or up to 10 or more and they can vary greatly in size, I do not think this is the best option.

If anyone knows a better way of doing this I am all ears! Thanks in advance for any assitance.

Propig 04-26-2002 10:34 AM

Re: Any Access or VB Experts
 
Doh! I got it! It was so easy.

   For Each fld In frst.Fields
       Set ctlText = CreateControl("frmvalidationfile", acTextBox, acDetail, , fld.Name)
       ctlText.Name = fld.Name
   Next

wizbones 04-27-2002 02:39 PM

Re: Any Access or VB Experts
 
Propig,

WTG,  ::)

I love seeing a post and answer both from the same person. It's amazing. Glad you figured it out so quickly, sometimes just writting it out it just screams at you "Here I am".

Someday maybe I'll learn this stuff but for now I'll leave it to you and just learn bits n pieces from your posts.

Propig 04-29-2002 08:40 AM

Re: Any Access or VB Experts
 
Anytime you need help......


All times are GMT -5. The time now is 10:29 AM.

Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.