entryfields

  • Thread starter Thread starter Jean-Paul De Winter
  • Start date Start date
J

Jean-Paul De Winter

Hi,
I have a form with about 12 entryfields named entryfield1 to entryfield13.
I must asign a value to this entryfields...
can I put the "entryfield" name in a loop like:

entryfield+x
x=x+1

where is is a value from 1 to 13

what is the correct syntax to do so?
Thanks
JP

--

Mvg.
Jean-Paul De Winter

Onze website....
www.kine-dewinter-deckers.be
 
This sort of thing should do it:

Dim strField As String
Dim i As Integer
For i = 1 to 13
strField = "entryfield" & i
Me(strField) = i
Next
 
Great thanks...
Problem solved
JP

Allen Browne said:
This sort of thing should do it:

Dim strField As String
Dim i As Integer
For i = 1 to 13
strField = "entryfield" & i
Me(strField) = i
Next
 
But... shouldn't I add a ! in your code?( in the strField)

Something like:

Dim strField As String
Dim i As Integer
For i = 1 to 13
strField = "!entryfield" & i
Me(strField) = i
Next
JP
 
No.

The expression:
Me("MyField")
is shorthand for:
Me.Controls("MyField")

You don't need the bang for that construct.
 
Back
Top