T
Tom Rogers
I have a set of form fields with helpful names like PxName, PxAddress, etc.,
where x is 1, 2, 3, or 4.
There are quite a few fields per x, and I would like to write this the
elegant way, along these lines:
-----
For i = 1 To 4
aThisRecord = GetParents(iStudentID, i) ' returns an array with record
info
With Reports![SR4 - VBC]
Eval ("!P" & i & "Name = aThisRecord(0)")
Eval ("!P" & i & "Address = aThisRecord(1)")
End With
Next i
-----
However, when I run the code I get the following error on the line with the
first Eval statement:
Run-time error '2423':
The expression you entered has an invalid . (dot) or ! operator or invalid
parenthesis.
I've tested my construction with a MsgBox and got what I wanted:
!P1Name = aThisRecord(0)
When I hard code that line myself, it works just fine. I've also tested the
value of aThisRecord(0) and it's exactly what I want.
Anyone know what I'm doing wrong?
where x is 1, 2, 3, or 4.
There are quite a few fields per x, and I would like to write this the
elegant way, along these lines:
-----
For i = 1 To 4
aThisRecord = GetParents(iStudentID, i) ' returns an array with record
info
With Reports![SR4 - VBC]
Eval ("!P" & i & "Name = aThisRecord(0)")
Eval ("!P" & i & "Address = aThisRecord(1)")
End With
Next i
-----
However, when I run the code I get the following error on the line with the
first Eval statement:
Run-time error '2423':
The expression you entered has an invalid . (dot) or ! operator or invalid
parenthesis.
I've tested my construction with a MsgBox and got what I wanted:
!P1Name = aThisRecord(0)
When I hard code that line myself, it works just fine. I've also tested the
value of aThisRecord(0) and it's exactly what I want.
Anyone know what I'm doing wrong?