Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto Populate? (Access 2000)

    If i have a drop down for city and another for county on a form, how can i get it so that when i click on the city , the correct county in the other text box automatically appears

  2. #2
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    You need to populate the 2nd combo to the first:

    (Attached is a demo for A2000, you have not stated which version you are using)

    If you check the design of the 2nd comb, you'll see how the 2 are related in the criteria.
    You will need to select the row source and click the icon to the right with the 3 dots.
    Here you will see the solution.
    Attached Files Attached Files

  3. #3
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    I do have Access 2000 but that database did not work for me . Any other ideas from anyone?

  4. #4
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    I do have Access 2000 but that database did not work for me

    Can you explain what happens when you open it ?
    Are you getting any errors ?

    If you give a better explanation, I may be able to help.

  5. #5
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    nothing happened, when i clicked on city, nothing auto populated

  6. #6
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    Basically, when you select from combo1, you have to open combo2 to see the data quried.
    But,
    For your purpose, I have changed the combo's to list box's for you to see.
    Attached Files Attached Files

  7. #7
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    I understand That one but I dont understand why you say "Like Combo0" under City?

  8. #8
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    The first list collects all the data from table7.
    You have to have all the cities to start off with so the second list or combo can filter the information.
    The second list or combo, binds itself to list 1 via the code :Like [forms]![frmSimple]![combo0]

    If you check the example, the expression from the second list binds itself to the "City" in the first list.
    This is how the information is filtered ie: City <> City

  9. #9
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    I dont know i did all that and it doesnt work still?

  10. #10
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    I think it would be better if you put a small zipped demo (Under 100k) together and attach it to a post.

    I'll see if I can help you that way.

  11. #11
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    Here is the attachment, What I want is when you click city, for the district and standing order to automatically fill in
    Attached Files Attached Files

  12. #12
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    There is a problem with your attachment and VBA, something is corrupt.
    I've updated the previous attachment I posted with your table contents.

    You will need to study the rowsource properties (Click the three dots once field highlited) which holds a query.
    You will also need to look at the On_Click property for each combo.

    Basically what this demo shows is how each combo is related to each other via the query.

    Combo0 holds all the contents of the table
    Combo2 queries the result of Combo0
    Combo3 queries the result of Comb2

    Can you see how this cascades ?

    On the click property for the first two Combo's, we requery the next Combo

    eg :- Me.Combo2.Requery

    I added a Null statement before this command so as not to show the values from the last selection.

    e.g:- Me.Combo2 = Null
    Attached Files Attached Files

  13. #13
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    Ok i see what you mean completely, only thing i am wondering now is if i select first town can ABC and 123 automatically appear in the other boxes without even clicking the 2nd and 3rd combo box?

  14. #14
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    In your original post, you mention selecting from two combo's !!

    I've updated the demo using two unbound texts only as an example.

    This method is far more easier.
    If you again look at the properties you will see how I have related the info:-
    =Combo0.Column(1) etc

    Remember these fields are unbound only for demonstartion, if they are bound, you can save them into the table.
    Attached Files Attached Files

  15. #15
    3 Star Lounger
    Join Date
    Jun 2003
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Populate? (Access 2000)

    Dave, Thanks so much for putitng up with all my posts, i got it to work, I truly appreciate it

    Take care
    Jordan

Page 1 of 2 12 LastLast

Posting Permissions

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