Hey guys

jkainth

New member
Local time
Today, 15:25
Joined
Oct 28, 2004
Messages
8
i have form with textboxes, which gets populated with a query...(example):

firstname(labels) lastname age
------- -------- ----
john (textboxes) Brown 30
linda pillon 42
.
.
.

the user can make any changes to the above data while in the textboxes. There is a button in the footer section which when clicked should take the above data and write it to a text file.

the question is..... when the button is click i need a way to move through the textboxes and get their data. since the records displayed can vary(the number of textboxes migh be more sometimes sometimes less) how do i get the values??

help plz
 
Rather than exporting the table, export a query. Use the same selection crtieria used to populate your form. The TransferText Method can use an export file spec if necessary.
 
Hey

Well the example i have shown above is fairly simple, but what i am doing is quite very complex. There is alot a calculations that i do on the queried data. Moreover there are textboxes that get filled with data that doesnt arrive from the query. So exorting the qury isn't much of an option.

What i really need to is to find a way to iterate through the text controls and get the data.

plz help me with that.

P.s ( in vb6 when we create dynamic controls we use the index 0 to specify the first control and then use an array to create the rest...is it done the same way in vba?...if so that might be a way to solve it......)

Plz help
 
j,

You can Loop through your controls by name. If you name your controls
Text0 --> Text27 this will work:

Code:
For i = 0 to 27
   Temp = Me.Controls("Text" & CStr(i))
   Next i

Wayne
 

Users who are viewing this thread

Back
Top Bottom