B
BrainlordMesomorph
With the Me function (I think it's a function) I can build a string
that refers to a field on a form as in:
(Supposing I had 5 fields named Field1 through Field5)
For i = 1 to 5
Me("Field" & i) ="fnord"
Next i
Now I need that exact functionality in an ADO call:
Set RS = CurrentDb.OpenRecordset("myTable")
For i = 1 to 5
RS.("Field" & i) =" fnord"
Next i
I cannot get MSA to understand that I'm talking about a field. The
error is "cannot find field named "RS. Field1"
If I put the text "RS. Field1" in the code there it works fine.
And oddly, if I put a bad fieldname as in "RS. FieldX" The error is
"cannot find field named "FieldX" (without the RS. object)
I've tried dimensioning a variable as a field and setting that to the
string, no good. Same error. Tried using the Me function, that only
seems to work on a form.
It's just got to be a syntax thing. How the hell do I concatenate an
ADO call?
Can anyone point me to an example??
Aha tia blm
that refers to a field on a form as in:
(Supposing I had 5 fields named Field1 through Field5)
For i = 1 to 5
Me("Field" & i) ="fnord"
Next i
Now I need that exact functionality in an ADO call:
Set RS = CurrentDb.OpenRecordset("myTable")
For i = 1 to 5
RS.("Field" & i) =" fnord"
Next i
I cannot get MSA to understand that I'm talking about a field. The
error is "cannot find field named "RS. Field1"
If I put the text "RS. Field1" in the code there it works fine.
And oddly, if I put a bad fieldname as in "RS. FieldX" The error is
"cannot find field named "FieldX" (without the RS. object)
I've tried dimensioning a variable as a field and setting that to the
string, no good. Same error. Tried using the Me function, that only
seems to work on a form.
It's just got to be a syntax thing. How the hell do I concatenate an
ADO call?
Can anyone point me to an example??
Aha tia blm