Error with textbox

  • Thread starter Thread starter mike
  • Start date Start date
M

mike

Hi all,

I'm trying to look up a value from a table and assign it
to a text box. Somehow, its giving me an error.

The code is:

Dim strname As String
strname = DLookup("[UserName]", "User", "[UserID]=" &
Me.UserID)
Forms!ComputerEquipment!Text28 = strname //Error can't
assign vale to
text box
Thanks for the help..

mike
 
mike said:
Hi all,

I'm trying to look up a value from a table and assign it
to a text box. Somehow, its giving me an error.

The code is:

Dim strname As String
strname = DLookup("[UserName]", "User", "[UserID]=" &
Me.UserID)
Forms!ComputerEquipment!Text28 = strname //Error can't
assign vale to
text box
Thanks for the help..

mike

If Not IsNull(DLookup()) then
strname = DLookup()
Forms!ComputerEquipment!Text28 = strname
Else
Forms!ComputerEquipment!Text28 = Null
End If
 
Back
Top