Results 1 to 8 of 8
  1. #1
    AccessAccess is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    4

    LookupField1 filters selections for lookupField2?

    Hey everyone,

    I consider myself new to access having only created some simple databases.

    I have come across this question many times but it hasn't been a requirement for any databases yet.
    Now, I am creating a database and for simplicity we will say it has 3 tables, 2 of which are lookup tables for the customer table:

    Customer Table
    =Fields=
    -CustomerName
    -CustomerProvince (lookup: CustomerProvince table - CustomerProvince)
    -CustomerCity (lookup: CustomerCity table - CustomerCity)


    CustomerProvince Table
    =Fields=
    -ProvinceCode
    -CustomerProvince

    CustomerCity Table
    =Fields=
    -CustomerCity
    -ProvinceCode



    My question is, on my Customer table when I select a value for CustomerProvince field, how do I filter the selections now available in the CustomerCity field on the customer table, to only show cities that are in that province?

    My goal is to make it simple as possible for the user who will be inputting new customers with forms. Below is an attachment of a pic with a simple ERD.
    Click image for larger version. 

Name:	simpleErd - access question - Table 1 filters for table 2.png 
Views:	8 
Size:	9.1 KB 
ID:	11698

    Any help is appreciated.
    -M

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Sounds like dependent (cascading) comboboxes. Review http://datapigtechnologies.com/flash...combobox2.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    AccessAccess is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    4
    I have seen this example of Cascading comboboxes.
    I just do not understand what relationships/tables to make or what queries or tables/fields to make my form off of.

    My customer form would include:

    CustomerName
    CustomerAddress
    CustomerCity
    CustomerProvince
    ...etc.

    where City and province would be the cascading comboboxes.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    You need a table that has records to associate City and Province and maybe also mail code.

    tblCityProvinceMC
    CityName
    ProvinceName
    ProvinceCode
    MailCode
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    AccessAccess is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    4
    is there a relationship required from that table(tblCityProvinceMC) to the Customer table?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Only if you want to save an ID value for the CityProvinceMC data instead of saving each component individually in the Customer table.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    AccessAccess is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    4
    This may be a "dumb" question... but what is the difference?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    If you save the ID then will always have to retrieve the City/Province/MC related info by joining tables. Saving the ID can be made to work with only 1 combobox by having user enter the city and make choice from the rows that match the entered city. This assumes you have full address info on the new customer.

    If you save the components then no table join required but have to enter/select 3 pieces of data instead of one.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. A running sum and filters
    By Marin in forum Reports
    Replies: 4
    Last Post: 07-28-2013, 02:00 PM
  2. Help with filters
    By daltman1967 in forum Forms
    Replies: 5
    Last Post: 07-14-2011, 02:12 PM
  3. Replies: 9
    Last Post: 05-23-2011, 06:12 PM
  4. Form Filters Help
    By JeffG3209 in forum Forms
    Replies: 1
    Last Post: 05-22-2011, 10:31 PM
  5. About filters
    By registan in forum Forms
    Replies: 12
    Last Post: 04-09-2011, 08:01 AM

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