changing field source and standard value of form contols

willem

Registered User.
Local time
Today, 16:42
Joined
Jun 17, 2001
Messages
41
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
 
when referencing group fields of the "same name", i usually do this type of routine:

strsource = 1/1/2001
for i = 1 TO 31
Forms!FormName("Text" & i).ControlSource = DateAdd("d",i - 1,strsource)
Next

[This message has been edited by joeyreyma (edited 07-19-2001).]
 
I used the technique you proposed.
But there is still a problem.
I change the value of a textbox in the on load event but i can't change the controlsource.

Thanks for your replies

Willem
 
You seem to be storing individual days as fields, surely you only need one date entry field?

[This message has been edited by Rich (edited 07-20-2001).]
 
It looks as though you have 31 fields one for each day of a month, is that what you do?
 
Yes , I believe we already met.

My problem is solved but maybe you have a better solution.

And


If you really want to help me have a look a my latest problem

A query problem

Willem
 
More than one of us has tried to help you Willem, I'm sorry that we've been unable to convince you regarding the basic design of your database, maybe the answer Raskew has now given will help.
 

Users who are viewing this thread

Back
Top Bottom