I have searched some time to be able to pull a value not in my report table to my report. I found that I was able to use the DLookup function to get that variable upon opening my report. My issue is when I try to assign that variable to an unbound text box in the report. I get a run-time error. The run time error is shown below along with the code. Any advice would be greatly appreciated.
Run-time error '-2147352567 (800200009)':
You can't assign a value to this object.
Code:
Private Sub Report_Open(Cancel As Integer)
Dim stLocation As String
stLocation = DLookup("[fldLocationName]", "[qryLocationByUser]")
'check to verify correct data
MsgBox stLocation, vbOKOnly, "My Location"
Me.txtLocationbx = stLocation
End Sub