Re: Filter List Box



for this to work properly you need to have at least 2 tables

vendor table

vendor_id numeric
vendor_name string
......


products

product_id numeric
vendor_id numeric
description string

in the on change event for the combo box,

dim SQL as string

SQL = "Select * from products Where vendor_id=" & me.cboVendor.value

me.lstProducts.rowsource = SQL
me.lstProducts.requery

you will have to setup your list box for table/query

hope that answers you question.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

"Ann Moller via AccessMonster.com" <forum@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:df169ece58b648f8b810a4fa71211c0c@xxxxxxxxxxxxxxxxxxxx
>I have a combo box that picks a vendor. I have a "list box" that I want to
> list all the products for the vendor in my combo box.
>
> I've looked at similar listings but none really answers the how to do
> this.
>
> Does anyone know how I can structure this with code?
>
> Thanks,
> Ann
>
> --
> Message posted via http://www.accessmonster.com


.



Relevant Pages

  • Re: replace special character for filename save
    ... "Dave Peterson" wrote: ... Dim myChars As String ... I get a 1004 error message whenever I run it and the vendor name has either ...
    (microsoft.public.excel.programming)
  • Re: Uppercase to Mixed Case Edit in Field
    ... The field is ONE field: Vendor. ... Corp) or it may have a person's name (JOE SMITH). ... Dim strFirstLetter As String ... Private Sub FirstName_AfterUpdate ...
    (comp.databases.ms-access)
  • Re: replace special character for filename save
    ... I get a 1004 error message whenever I run it and the vendor name has either ... Sub SaveWork() ... Dim vennumber As String ...
    (microsoft.public.excel.programming)
  • Re: vba sort a query
    ... that i have on a 'filter' button so when I click the filter the ... comboboxes but sort by what is selected in the sortby combobox. ... the choices in the sortby combobox are Branch, vendor, item and year ... Dim strdoc As String ...
    (microsoft.public.access.formscoding)
  • Re: Search keyword from string of data (Please help!)
    ... I need to identify from this string ... of data the name of the vendor using some keywords. ... You build a query as I detailed above. ...
    (comp.databases.ms-access)