I am writing a function to fill in the data in an unbound form.
I have a table with field names of 1, 2, 3 etc up to approx 100. I have
an unbound form with fields called 1, 2 3 etc.
I gave everything names like this because I wanted to simplify the
function which fills the unbound form with data. So:
forms![myForm]![1] = rs![1]
works fine, similarly with 2 and so on. But there are 100 fields so I
want to wrap the whole thing in a loop, like
for i = 1 to 100
forms![myform]![i] = rs![i]
next i
but this doesn't work.
Similarly with the field labels, I have
forms![myform]![label1] = getlabel(1) where getlabel() is a little
function that returns a text string.
Can anyone help me with the syntax to get this right so that I can open
the unbound form, and fill in all 100 field labels and field data with
just a few lines of code
Thanks
Dave