Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Location
    Fargo, ND
    Posts
    2

    Unanswered: Combobox's and coding question

    I am building a database for tracking medication errors in our facility. Here is my scenario:

    I have a combobox with 5 options when it drops down and I have a combobox below it that will contain options when opened that depends on the one above it.

    i.e.

    Combobox1 has choices a, b, c, d, e
    If a is chosen combobox2 will contain the items pertinent to a.
    If b is chosen combobox2 will contain the items pertinent to b.
    and so on and so on.

    I would appreciate if someone would point me in the rih=ght direction. I know I am close, but I can't find any help in the access 2000 wizard or in my Access 2000 book.

    Bob

  2. #2
    Join Date
    Nov 2003
    Location
    New Zealand
    Posts
    47
    Hi

    You need to set the combobox2 row source property to a Query that will get vaules form your table where combobox1 value is true.

    ie if combobox1 = a
    then select * from table where table.field = combobox1(a)

    SELECT "fields"
    FROM Table
    WHERE "table.fields"=[Forms]!["form name"]!["comboboxname"]));

    You can use the expression builder to get the syntax right.

    You will also need to write some code in the afterUpdate event of combobox1 to requery combobox2 everytime you pick a value.

    me.combobox2.requery

    Im not sure on the syntax
    hope this helps
    Nerdy Girl

  3. #3
    Join Date
    Jan 2004
    Location
    Fargo, ND
    Posts
    2
    I will give it a try. Thanks Nerdy Girl!

    Bob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •