Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2014
    Posts
    18

    Unanswered: Help! Access Auto Populate

    Hi all,
    Thank you so much for reading my post. I am pretty new to Access, although I have been familiarizing myself quite a bit with the basics.
    I work for a college. We conduct community classes for Law Enforcement. I am trying to create a database that I can use to register people for classes. I will run queries to act as class rosters.

    Anyway, I am stuck. I wanted to create a form in which I can type (or choose from drop down) the agency an officer is from, and it would auto populate the address, county, state, and zip. Then I wanted to be able to type (or choose from drop down) an agency contact name, and it would auto populate their phone number and email. Then I wanted to be able to type in the class they are registering for, the person who is processing it and any individual notes on the officer I may need to type in.

    I wanted all of this on the same form.

    I have tried creating a combo box in multiple formats and I can't get it to do exactly what I want. I have attached the database here for your review (with fake data).

    You will see there is a form called "frmTEST". In that one, you can choose the agency, and the county and address will auto populate. The problem is, I can't get it to do that on ONE universal form. For instance, the form "frmAgencyInfo" is also successfully auto populating, but I can't add the other information I need to add to that form. For instance, I can't add the agency contact, and have that auto populate as well.


    In review, I want a registration form where I can enter Joe Schmoe into the form and register him for the class. To avoid entering the same information multiple times, I wanted parts of the form to be auto-populating.
    Help?!

    NOTE: I created subforms because I thought I could use those, but that wasn't working to auto populate either.

    Thank you so much!

    ~Access Newb in California!~
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    A combobox can have several columns and some of then can be hidden (i.e. not visible in the list).
    The RowSource property of the combo would be something like:
    Code:
    SELECT agency, address, county, state, zip FROM TableName;
    In the AfterUpdate event handler of the combo you can use:
    Code:
        Me.Text_address.Value = Me.ComboName.Column(1)
        Me.Text_county.Value = Me.ComboName.Column(2)
        Me.Text_state.Value = Me.ComboName.Column(3)
        Me.Text_zip.Value = Me.ComboName.Column(4)
    And the same goes for the second combo.

    Note: Replace the names in blue by the actual ones in your project.
    Have a nice day!

  3. #3
    Join Date
    Apr 2014
    Posts
    18
    Hmmm, thanks for the reply. Not sure what I am doing wrong, but its still not working. I am probably newer to this than you realize! Any way I can get more explanation? I tried plugging in those codes to the correct spot but its not doing anything.

    I think I need help in the way I am setting up the combo box. What to select and if I need to save my values and stuff like that...

    Thanks.

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Depending on whether the form is bound or unbound, there are 2 possibilities. See the sample forms in the attached database.
    Attached Files Attached Files
    Have a nice day!

  5. #5
    Join Date
    Apr 2014
    Posts
    18
    Great, thank you for the sample, I'm gonna check that out now! What is the difference between bound and unbound? Seems like they are both doing the same thing (auto populating).

    THANKS.

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    A bound form is "linked" to a table or query, while an undound form is not.
    Have a nice day!

Posting Permissions

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