Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    32

    Unanswered: Access 2000: Select name from list but use ID in query

    Hi:

    Access 2000

    We have a publications database of geological books, maps and digital data that we produce. Each publication is assigned an area (townships, NTS, MNR Area) based on the study area. I am trying to create an Access search tool (the data resides in our Golden Oracle Database) to query the publications database. All of it works but I am going back now after having created it several months ago and I noticed a piece of code I would like to revise.

    To search by geographic area, I provide a list of areas (townships for example) and the user selects one or more. In the townships_master table, the township name is tied to a township id (for example Gerow = 1234). The problem is that I don't know how to use the ID to search for publications - I created a workaround whereby I search the townships table for "Gerow" to get the ID (1234) and then I search the publications_area junction table for ID=1234. Is there any way of displaying the list of human-readable names but directly tying the names to the ID so that the intermediate step of querying the townships_master table for the ID may be removed.

    I know how to do it on web forms - the "name" attribute can carry the ID while the user selects the name from the list but Access works a little differently.

    TIA,

    Jules
    Jules

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Use a multi column combo box.

    For example, you could have a two column combo box:

    field_id, field_desc

    Then set the display widths to:

    0";1"

    and bind the combo box to the first column
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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