G
Guest
Thanks for taking the time to read my question.
I have a table with field names like Field1, Field2, Field3 etc.
I want to refer to each field in code and add a value to each.
Here is my code:
Do Until rst.EOF
CurrentPyramid = rst!SowBarn
Do Until CurrentPyramid <> rst!SowBarn
With rst2
.AddNew
!Barn & x = rst!FeederBarn
.Update
x = x + 1
End With
rst.MoveNext
Loop
Loop
Where x is an integer, how do refer to the field name properly? I tried
!Controls("Field" & x) = rst!FeederBarn but that didn't work. I don't think
the Controls part is correct.
Any ideas?
Brad
I have a table with field names like Field1, Field2, Field3 etc.
I want to refer to each field in code and add a value to each.
Here is my code:
Do Until rst.EOF
CurrentPyramid = rst!SowBarn
Do Until CurrentPyramid <> rst!SowBarn
With rst2
.AddNew
!Barn & x = rst!FeederBarn
.Update
x = x + 1
End With
rst.MoveNext
Loop
Loop
Where x is an integer, how do refer to the field name properly? I tried
!Controls("Field" & x) = rst!FeederBarn but that didn't work. I don't think
the Controls part is correct.
Any ideas?
Brad