Hi all.
I am new to access.
Does anyone know how to pass value from TextBox to ComboBox in VBA?
Controls in my form:
ItemCode textbox - user to key in the itemcode
SpeID1 textbox - LEFT(itemcode,2)
SpeID combobox - pass value from SpeID1 textbox to SpeID combobox
Desc textbox - Dlookup Desc from Species table using SpeID
The Desc will come out if I run the following code by choosing the value from the dropdown combobox without using the SpeID1 textbox
Code:
Private Sub SpeID_AfterUpdate()Desc = DLookup("Desc", "Species", "SpeID='" & SpeID & "'")End Sub
but what I want here is the user need not to choose the value from the SpeID Combobox and the SpeID and Desc will come out automatically after the user enter itemcode.
I try to use SpeID1_AfterUpdate() but no value appears at the Desc.
Anyone here kindly share your advice with me.
Thanks.