Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    292

    Unanswered: drop down text box help...

    I have a UNION query that looks like:

    PS12
    PS34
    PS9
    PF34
    PF5
    SO2
    SO12

    I want to create a drop down text field on my form that will pull by the first two letters.

    So, from the example above.. my combo field would list.. PS,PF,SO

    If the user selects ... say PS
    the result I want to come back would be..

    PS12
    PS34
    PS9


    How can I do this ?

    thanks

  2. #2
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Re: drop down text box help...

    Originally posted by TonyT
    I have a UNION query that looks like:

    PS12
    PS34
    PS9
    PF34
    PF5
    SO2
    SO12

    I want to create a drop down text field on my form that will pull by the first two letters.

    So, from the example above.. my combo field would list.. PS,PF,SO

    If the user selects ... say PS
    the result I want to come back would be..

    PS12
    PS34
    PS9


    How can I do this ?

    thanks
    Is the union query the row source for the combo box? Which ever is your row source, use the Left function in it to get the first two letters.

    Select Distinct Left(tblSomething.Something, 2) from tblSomething.

    This will give you the row source for the combo box but you may have to write some code to filter out the records you want.
    Gregg


    DAO, ADO, SQL, Automation and anything else I can pick up.

  3. #3
    Join Date
    Jul 2003
    Posts
    292
    I tried as you suggested.. my UNION query is my row source ..

    Select Distinct Left(qryInspectionGraphUnion.INSPNAME, 2) from qryInspectionGraphUNION

    When I put that in my row source on my form A message from access pops up:

    Microsoft Access has encountered a problem and needs to close. We are sorry for the inconvenience.

    If you were in the middle of something, the information you were working on might be lost.

    For more info. about this error, click here.

    any ideas?

    thanks for you response.

Posting Permissions

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