Results 1 to 4 of 4
  1. #1
    Oblivion_Creed is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2017
    Posts
    20

    Can i make a user choose a certain

    I want to make a user fill the city where he lives and the street in the city where he lives.

    now i have 2 tables:

    city


    street

    in street i can create a street after choosing the city in which the street is.
    How can i make the user choose only streets from the city he filled

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,936
    you need to make your street control a combobox and have its rowsource with a criteria to select your streets based on the city entered. e.g.

    On a form you have a textbox - txtCity

    and your combo (cboStreet) would have a rowsource of "SELECT Street FROM tblStreets WHERE City = '" & [txtCity] & "'"

    and finally a bit of code in your cboStreet on enter event

    me.cboStreet.requery

  3. #3
    Oblivion_Creed is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2017
    Posts
    20
    Quote Originally Posted by Ajax View Post
    you need to make your street control a combobox and have its rowsource with a criteria to select your streets based on the city entered. e.g.

    On a form you have a textbox - txtCity

    and your combo (cboStreet) would have a rowsource of "SELECT Street FROM tblStreets WHERE City = '" & [txtCity] & "'"

    and finally a bit of code in your cboStreet on enter event

    me.cboStreet.requery
    Im really new to Access and i have no idia what "combobox" is and what text do i have on a textbox....

    could you please make a more detailed guide for that?

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,936
    Appreciate you have to start somewhere, but only if you provide more detail about your tables and the reason for the database, how you want it to work etc., otherwise it is pure conjecture

    Before doing so, you might want to make use of google/bing to find out a bit more - google 'access textbox' and 'access combobox' for example and take a look at the template databases provided with access to gain a better understanding. You will also find plenty of training videos and examples online

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

Similar Threads

  1. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  2. Replies: 3
    Last Post: 07-23-2012, 11:46 AM
  3. forcing the user to choose a value
    By fabiobarreto10 in forum Forms
    Replies: 16
    Last Post: 04-15-2012, 09:52 PM
  4. Replies: 1
    Last Post: 10-05-2011, 04:36 PM
  5. Replies: 6
    Last Post: 06-09-2011, 03:41 PM

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