Results 1 to 5 of 5
  1. #1
    marix is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2007
    Posts
    4

    look up query

    Hi,

    In my access table(2010) I have a field called 'Site'(lookup to a query to list all sites)

    I also have a field called 'rooms'.

    Now for the tricky part.

    When I select a value in the 'site' field I want to display all the rooms from the chosen site in the 'room' filed, so the user can then select which room is required.



    I can do it manuall using this sql:

    SELECT tblLocation.Room
    FROM tblLocation
    WHERE tblLocation.site="Site1";
    I have six sites each with different rooms.

    So, in this example "Site1" needs to get its information from the selected text in the 'site' filed.
    I am finding this hard to explain so I hope somebody can understand me :O)

    Thanks in advance

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    What you are describing are called cascading combo boxes. Here is good tutorial on how to make it work for you.

    http://www.fontstuff.com/access/acctut10.htm

    Alan

  3. #3
    marix is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2007
    Posts
    4
    Hi,

    Thanks for the response. Yes, this is what I want but I don't want to use forms. I am working from the table directly. Is it possible to do it this way?

  4. #4
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    ooooh. Working directly in tables in not a good idea. To many opportunities to make errors and overwrite fields. It is always best to have users work with in forms so that you limit what can or cannot be accessed or changed. Having given my spiel on that, I don't know how you would attach any VBA actions to a table. I have never done it nor even heard of it. All automation is through forms.

    And finanlly, here is a link on why you shouldn't use lookup tables in tables.

    http://access.mvps.org/access/lookupfields.htm

    Sorry to be so down on your methodology but ......

    Alan

  5. #5
    marix is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2007
    Posts
    4
    Thank you so much for your time. I have taken your advice and achieved exactly what I wanted by using forms and VB. Can't believe I didn't want to use forms - things have just become much more interesting!

    cheers!

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums