entryfields

  • Thread starter Jean-Paul De Winter
  • 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
 
A

Allen Browne

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
 
J

Jean-Paul De Winter

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
 
J

Jean-Paul De Winter

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
 
A

Allen Browne

No.

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

You don't need the bang for that construct.
 

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

Top