alter the name of a control or field

F

Frank Dulk

Is it possible to alter the name of a control or field inside of a
procedure?
I need to accomplish a consultation and to fill out a temporary table with
the obtained results, they put, separate for columns (mes1, mes2,... mes6).
As in the example below:
i = 1
n = 6
For i = 1 To n
....
.....
......
Do Until Rsh.EOF
Tbl.AddNew
Tbl!Numero = Rsh!Numero
Tbl!TIPO = Rsh!TIPO
Tbl!Depart = Rsh!Depart
Tbl!Labor = Rsh!labor
-->Tbl![Mes + i] = Rsh!Data
Tbl.Update

Rsh.MoveNext
Loop
i = i + 1
Next

Or be....
Would I like to alter the name of the field of the table [month?], using the
own increment of the loop, once my variable " N " can have a value of 3 up
to 12 months.
 
P

Paul Overway

If I am understanding correctly....you are looking for something like

Tbl.Fields("Mes" & i) = Rsh!Data
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top