kentwoodjean
Technical User
I have a form with a list box that upon selection of an item, other fields with customer address information are populated. This works great using the following:
Private Sub List18_Click()
Dim szSQL As String
Dim szContractNum As String
szContractNum = Me.List18.Value
szContractNum = LTrim(RTrim(szContractNum))
szSQL = "select * from qryTransMaticMembers where CONTRACT_NUM = """ & szContractNum & """;"
Me.Form.RecordSource = szSQL
End Sub
Due to the size of the database, my users now only want a text box they can type an entry (Contract_Num) that will do the same as the list box in populating the other fields. I worked so hard to get the list box working correctly and now I have having trouble converting this to the text box only.
I thought I could use the same format and change the List18 to Text20 and rather than Click change that event to After Update. It is a no go. Any ideas on how I can adjust the above VB to fix my text box would be appreaciated. I am in the process of teaching myself VB via a MS book and disk.
Private Sub List18_Click()
Dim szSQL As String
Dim szContractNum As String
szContractNum = Me.List18.Value
szContractNum = LTrim(RTrim(szContractNum))
szSQL = "select * from qryTransMaticMembers where CONTRACT_NUM = """ & szContractNum & """;"
Me.Form.RecordSource = szSQL
End Sub
Due to the size of the database, my users now only want a text box they can type an entry (Contract_Num) that will do the same as the list box in populating the other fields. I worked so hard to get the list box working correctly and now I have having trouble converting this to the text box only.
I thought I could use the same format and change the List18 to Text20 and rather than Click change that event to After Update. It is a no go. Any ideas on how I can adjust the above VB to fix my text box would be appreaciated. I am in the process of teaching myself VB via a MS book and disk.