Results 1 to 3 of 3
  1. #1
    Lisa is offline Novice
    Windows 10 Office 365
    Join Date
    May 2021
    Posts
    1

    Fill combo boxes in forms by using the other combo boxes as critera.

    Hello everybody,

    I am absolutelynew at using access. I read and tried a lot for solving my problem, but nothing really worked. So here is my problem.



    I have one table with different records in it. In my test databse I got four different fields: ID, First Name, Last Name, City

    What i want to do with this is, to filter for one of these fields to fill the other fields with the information of the record which belongs to this.For example: I fill in the number 1 in the combo box ID and the rest of the combo boxes get filled with information from record with the ID 1.

    I used this:
    [Formulare]![Formular1]![ID] and added in code builder: Private Sub ID_AfterUpdate()
    Requery
    End Sub
    This actually worked for one field, so I fill the field ID and I got all the information in the other boxes.
    But my goal has to be fill one of the four boxes, not only ID, with information in order to get filld the other ones automatically.
    Is there an easy way to do this?
    I will be so happy if anyone could give me tipps how can I solve this.

    Kind regards
    Lisa

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,471
    Lisa what field would they search on to pull up the record, I assume it is Last Name? Or you want them to be able to search by First Name and City also? Typically you have 1 combo box stay at top and they search that say by Last Name and once they select that in the AfterUpdate property you can pass the other fields from the combobox to the other fields (Last Name, First Name, City) by using me!ID.column(1) say for First name, me!ID.column(2) for Last name. It depends on how you set up the fields in the combo box on the order.

    Or do you really want 3-4 combo boxes so they can search by any of those fields?

  3. #3
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,411
    Here's a sample db that has dynamic cascading comboboxes. You need not make combobox selections in a fixed order, any jumping around amongst them will work.

    Lisa-davegri-v01.zip

    In this example, there are 2 members with first name Rame, one in Cleveland and one in Dallas.
    The 5 textboxes with SQL show how each combobox rowsource is modified as choices are made within the various comboxes. The textboxes can be deleted. They were included for debugging and showing how things work.

    Click image for larger version. 

Name:	Lisa.png 
Views:	22 
Size:	34.6 KB 
ID:	45389
    Last edited by davegri; 06-01-2021 at 11:08 AM. Reason: splaining

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

Similar Threads

  1. Replies: 5
    Last Post: 04-22-2021, 09:00 AM
  2. Text boxes auto fill after combo box update
    By royalbridge in forum Access
    Replies: 11
    Last Post: 07-13-2015, 11:56 AM
  3. Replies: 11
    Last Post: 08-06-2014, 09:47 AM
  4. Replies: 3
    Last Post: 06-09-2013, 05:35 PM
  5. Replies: 0
    Last Post: 06-29-2011, 01:04 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