G
Guest
Hi All,
Within my db I have a table containing BusinesstypeID and BusinessName.
I have created a form with a combobox wherein I can select the BusinessName
and the BusinessID is the result. (checked it with a msgbox).
Now within the form I have created a listbox in which I want to display all
CompanyNames ( from the table Contacts) having this BusinesstypeID.
The vba code used
Private Sub ComboBusinessType_AfterUpdate()
Me.lstCompanyName.RowSource = "select companyname,businesstype from contacts
where contact.BusinessType = " & [MeBusinessType.Value]
Me.lstCompanyName.Requery
end sub
The result within the listbox is the whole string I use, instead of the
required companyname.
What went wrong?
Greetings,
Harry
Within my db I have a table containing BusinesstypeID and BusinessName.
I have created a form with a combobox wherein I can select the BusinessName
and the BusinessID is the result. (checked it with a msgbox).
Now within the form I have created a listbox in which I want to display all
CompanyNames ( from the table Contacts) having this BusinesstypeID.
The vba code used
Private Sub ComboBusinessType_AfterUpdate()
Me.lstCompanyName.RowSource = "select companyname,businesstype from contacts
where contact.BusinessType = " & [MeBusinessType.Value]
Me.lstCompanyName.Requery
end sub
The result within the listbox is the whole string I use, instead of the
required companyname.
What went wrong?
Greetings,
Harry