Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: form controls


Message #1 by "wilfred van casteren" <vancasterenw@a...> on Thu, 19 Jul 2001 19:07:33
I have this form on which i created some fields, i need to change the 

source of 31 textboxes, they are named text1, text2, ... 

Is there a way to refer to these textboxes in the following way. 

Can you give me some comments on this? 



strsource = 1/1/2001 

for i = 1 TO 31 

counter=i 

strname= "text" & counter 

form.strname.recordsource= strsource 

form.strname.value= "text" 

strscource=strsource+1 

next i 

Thanks for your help 



willem









Message #2 by "Pardee, Roy E" <roy.e.pardee@l...> on Thu, 19 Jul 2001 12:12:20 -0700
Yes--the syntax you want is:



Form.Controls(strName).Value



HTH,



-Roy



-----Original Message-----

From: wilfred van casteren [mailto:vancasterenw@a...]

Sent: Thursday, July 19, 2001 12:07 PM

To: Access

Subject: [access] form controls





I have this form on which i created some fields, i need to change the 

source of 31 textboxes, they are named text1, text2, ... 

Is there a way to refer to these textboxes in the following way. 

Can you give me some comments on this? 



strsource = 1/1/2001 

for i = 1 TO 31 

counter=i 

strname= "text" & counter 

form.strname.recordsource= strsource 

form.strname.value= "text" 

strscource=strsource+1 

next i 

Thanks for your help 



willem



Message #3 by "Peter Kaufman" <kaufman@l...> on Fri, 20 Jul 2001 19:37:48 +0700
Hi Willem,



Would this be easier? Use the tag property of the controls.



Dim ctl as controls

'You may get some errors as not all controls have a tag property...

On error resume next

For each ctl in me.controls

 if ctl.tag = Mystring

  etc

 end if

next ctl



HTH,



Peter



> -----Original Message-----

> From: wilfred van casteren [mailto:vancasterenw@a...]

> Sent: Thursday, July 19, 2001 7:08 PM

> To: Access

> Subject: [access] form controls

> 

> 

> I have this form on which i created some fields, i need to change the 

> source of 31 textboxes, they are named text1, text2, ... 

> Is there a way to refer to these textboxes in the following way. 

> Can you give me some comments on this? 

> 

> strsource = 1/1/2001 

> for i = 1 TO 31 

> counter=i 

> strname= "text" & counter 

> form.strname.recordsource= strsource 

> form.strname.value= "text" 

> strscource=strsource+1 

> next i 

> Thanks for your help 

> 

> willem

> 

Message #4 by "Darron Michael" <darron.michael@h...> on Fri, 20 Jul 2001 20:34:32
> I have this form on which i created some fields, i need to change the 

It sounds like you are making a calendar.  I have a calendar form already 

created that lets you select start and end dates for a report.  You can 

change months or years by clicking arrow buttons forward or backward and 

you can select a particular day by clicking that day.  The days even 

shuffle around to the correct day of the week.



Want a copy? email me.

darron.michael@h...

8^)

Darron



> source of 31 textboxes, they are named text1, text2, ... 

> Is there a way to refer to these textboxes in the following way. 

> Can you give me some comments on this? 

> 

> strsource = 1/1/2001 

> for i = 1 TO 31 

> counter=i 

> strname= "text" & counter 

> form.strname.recordsource= strsource 

> form.strname.value= "text" 

> strscource=strsource+1 

> next i 

> Thanks for your help 

> 

> willem

> 

> 

> 

> 


  Return to Index