Results 1 to 7 of 7
  1. #1
    woodjl1650 is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    6

    AutoFill Query


    Database_vScrub.zipI have a database of contacts, is there a way to make a query that will put all contact info on a single row, if there are multiple entries?

    For example, my contact are state representatives and senators, the contact info I have breaks it down to what district and city the represent. So my goal is to have a single row based on the contact name.

    Name , Office, City1, City1AC, City1Number, City2, City2AC, City2Number, City3, City3AC, City3Number, ect.

    With out having to manually create each column header for the city number, is there a formula or query that will create those and populate the fields accordingly? There is one representatives that has a very large number of cities they represent, and looking to make process easier for future use.

    Thanks in advance.
    Last edited by woodjl1650; 01-17-2022 at 04:05 PM. Reason: grammer

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    10,639
    perhaps this
    http://allenbrowne.com/func-concat.html

    but if you're storing it that way, it will be a nightmare trying to query what were separate fields if that is all you will have.
    Better to zip and post files here. Many will not or cannot download from other external sources.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    woodjl1650 is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    6
    Zipped down, now able to attached. That totally slipped my mind. Thanks

  4. #4
    Ajax is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    9,843
    don't have time to make any suggestions right now - but do recommend you learn about data normalisation. Your existing structure makes your objective much more difficult to achieve.

  5. #5
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    2,996
    Maybe you need to rethink your strategy. I really don't see how a row with 246 (3 X 82 ) columns of repeating city information can be helpful.
    Can you explain a bit more how your database will be used, and the business problem that it is addressing/solving? Perhaps there is an alternate way.

    Click image for larger version. 

Name:	senators.png 
Views:	34 
Size:	13.7 KB 
ID:	47095

  6. #6
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,062
    I agree with those suggesting that you should review and apply Normalzation as appropriate.
    Also, if your plan is building some tool/utility to assist users, then I suggest some other format(s) would be more useful.

    As davegri asked -- what do you do with "a row with 246 (3 X 82 ) columns of repeating city information"????

    Something like the following may be useful.

    Senator/contact by Name vs Geo-Area
    Geo-Area by Senator/contact
    You may want separate list(s) or custom report for each Geo level

  7. #7
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    2,996
    Below configuration will present a normalized database with proper data entry/edit to maintain your data. However it does not address in what manner you wish to use the data as noted in post$5.

    Your configuration is Many-To-Many. Many persons relating to many cities, with many cities relating to many persons. That setup requires a junction table, like this:

    Click image for larger version. 

Name:	woodjunc.png 
Views:	23 
Size:	11.0 KB 
ID:	47100

    Along with a form like this:

    Click image for larger version. 

Name:	woodform.png 
Views:	23 
Size:	33.7 KB 
ID:	47105

    In a database like this:
    Attached Files Attached Files
    Last edited by davegri; 01-19-2022 at 10:32 AM. Reason: juggle attachments & images

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

Similar Threads

  1. Autofill help!
    By EJ_ in forum Access
    Replies: 16
    Last Post: 02-11-2019, 08:15 PM
  2. Replies: 1
    Last Post: 02-14-2015, 02:29 AM
  3. Autofill
    By Jpxfit in forum Access
    Replies: 4
    Last Post: 12-29-2014, 03:57 PM
  4. Autofill?
    By LeadTechIG in forum Access
    Replies: 6
    Last Post: 12-05-2014, 09:18 AM
  5. Autofill
    By kdcooper88 in forum Access
    Replies: 1
    Last Post: 09-18-2010, 05:52 AM

Tags for this Thread

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