So I'm attempting to change the value of a textbox on a form with VBA code.
I'm actually doing this by running a string as code so I can loop through a number of textboxes that are named similarly (RacewayOrder1, RacewayOrder2, etc...) and populate them all one at a time. So my code looks like this:
Private Sub FillRow(ByVal OrderNumber As Integer)
Dim tempstr As String
tempstr = "RacewayOrder" & OrderNumber & " = " & OrderNumber
Eval (tempstr)
End Sub
However, I am getting runtime error 2482 "Database cannot find the name 'RacewayOrder1' you entered in the expression"
I have verified that this isn't a typo, as I copied the text box's name directly into vba, but that doesn't seem to help. I even created the tempstr variable so I could inspect the code it is attempting to run, but that hasn't helped at all either.
To make matters more annoying, I debug.printed tempstr and pasted it in as a command, and it works fine.
Any advice?