Page 1 of 5 12345 LastLast
Results 1 to 15 of 64
  1. #1
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169

    HELP! How to auto-populate multiple fields using a single combo-box

    Hello newbie here!



    I just created a new db using Microsoft's Contact List db as a template. I have modified the fields and imported all my data, now I just need to tweark it to make it more functional.

    One thing I want to do is populate multiple fields on a form using a single combo box drop down. I have included a screen shot of the form for a visual...but Im clueless on where to begin. I am fairly familiar with how to create tables and how to link the data to the fields, but cant imagine what else is needed to link a single option to multiple fields. Any assistance would greatly be appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Is this what you're after?

    BaldyWeb - Autofill
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    That sounds almost exactly what I need by the description....Im afraid you are going to have to really dumb it down though for me in like how to go about doing that.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Doing what, exactly (a couple of directions are discussed)? This should help if you're going the code route:

    http://www.baldyweb.com/FirstVBA.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    I want to do it the easiest way possible...so no code if I can get by with it. The first article you provided though just gives an overview, Im still not sure what I need to select or what tools I would need to use to do that.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Did you get this sorted out? I feel like I included all the pieces in that link.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    still struggling...Im still a novice and the info provided is somewhat lacking for what I need to do.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What exactly have you tried? What is the row source of your combo? What specific problems are you having?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    I have created a seperate table containing all the info that will populate the fields. Then I start the combo box wizard selecting the option to pull data from a specific table. I choose the fields I want to use from my table but the wizard only allows me to output the selection to one field. I need to be able to have it output to multiple fields based on one selection from the drop down.

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The combo will only save to one field. You use one of the techniques in that link to either display or save the others.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    I think I got one step further using your links in combination with another one with a couple of more steps. I was able to successfully display the related info into all the fields, but I need to be able to also save this info as a new record when I select the item from the drop down. There will be multiple records in my db that will have the same data. So when I am creating a new record, I want to be able to choose the item from the drop down to have it fill in most of the form...then be able to save that as a new record once I have added all other unique data. I read on the link how to have it save to the table by using the 'after update event' with syntax: me.fieldname=combo box name.column(2) but this did not seem to save any data. Any ideas ?

  12. #12
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    correction...the syntax was like this:
    Me.TextboxName = Me.ComboName.Column(2)

    ...but this did not seem to work in my case. What does the 'me' represent?

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Me is a VBA alias to refer to a form or report object. It can be used in code that is behind the object being referenced.

    From the image you provided and info in posts, seems like you are duplicating data. The site and manager info should not be replicated into another table. Only save the unique ID for that site or manager record. Retrieve the detail info when needed by query joining tables. It is by join that you could display the related info on a form/report. No code would be required. I am presuming the form is bound (has a RecordSource). If not, the code method suggested by pbaldy could be used.

    Did you substitute the real names of your text and combo boxes into the suggested code? Or did you name the controls the same as in pbaldy's example as you show in latest post?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #14
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    yes I substituted the real names from my forms and tables using the same format as pbaldy. I created a seperate table only because I didnt have a unique identifier for a manager or site record, I only had it indentified by tech, so i had to create a seperate table containing manager/site data. Is it ok to leave it that way? Also please provide more details on how to accomplish the methods you mentioned (i.e joining,etc).

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Say I have a form to enter sale of a product (or purchase of inventory). I need to select the customer/vendor from table of contacts. The form purpose is to enter details of this sale/purchase (date, item, quantity, who). I have a combobox on the form to select the contact but I also want the contact details to show on the form in textboxes after selection in combobox. I set the RecordSource for the form as a query joining the sales table and the customer table on the customer ID fields. Jointype 'Show all records from Sales ...'. Pull the desired fields from both tables into the query. Then I bind textboxes for the customer details to the customer fields, except the CustomerID combobox is bound to the field in Sales table. I set the customer detail textboxes to Locked and TabStop No. I set locked, uneditable controls to transparent backstyle and editable controls to white backcolor.

    Does this fit your circumstances?

    Can you attach project for analysis?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Page 1 of 5 12345 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 12-05-2011, 01:55 PM
  2. Auto Populate two fields
    By funkygoorilla in forum Access
    Replies: 7
    Last Post: 08-31-2011, 09:06 PM
  3. Replies: 2
    Last Post: 12-07-2010, 12:32 PM
  4. auto populate mutiple fields
    By jomoan58 in forum Access
    Replies: 1
    Last Post: 07-23-2010, 01:03 PM
  5. Auto-Populate Combo box
    By vincenoir in forum Forms
    Replies: 3
    Last Post: 10-14-2009, 07:06 AM

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