gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
I have a form where I have a Combo Box. Based on whats selected in that combo I want to do a lookup in a table
My table Name is: tblItem
From the table I want to find the: ItemDescription
Based on the Value in my Combo Box named Combo53
Combo53 is storing the a value from the table - the field name in the table is ItemID
So it should be looking up the ItemID and finding the ItemDescription in the Table tblItem
I am getting an debug error Runtime 3464 Data Type Mismatch in Criteria Expression
The unbound Field on my form where I want the Dlookup results to go into is: TextItemDescription
My table Name is: tblItem
From the table I want to find the: ItemDescription
Based on the Value in my Combo Box named Combo53
Combo53 is storing the a value from the table - the field name in the table is ItemID
So it should be looking up the ItemID and finding the ItemDescription in the Table tblItem
Code:
Private Sub Combo53_AfterUpdate()
Dim ItemDesc As Long
ItemDesc = DLookup("ItemDescription", "tblItem", "ItemID = " & Forms![frm_LTA]!Combo53)
Me.TextItemDescription = ItemDesc
End Sub
I am getting an debug error Runtime 3464 Data Type Mismatch in Criteria Expression
The unbound Field on my form where I want the Dlookup results to go into is: TextItemDescription