Results 1 to 13 of 13
  1. #1
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232

    Combo box

    I have customer form that has a combo box where we pick the owners billing information from. It has a not in list event that opens a form to add owners info. On the owners form there is a text box for. Name, address, state, city, zip. I would like to have the combo box once selected with the right owner to show the following. Owner name. (Next line) address (next line) city, state, zip.
    The combo row source is a select query. The on not in list and the on dbl click is a event procedure .see attachment.
















    Thanks for your help


    Angie
    Attached Thumbnails Attached Thumbnails image.jpg  

  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,652
    Little hard to read upside down.

    is is this what you're after?

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

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    The combobox cannot show data from same record on multiple lines.

    Not sure how the code is relevant to the question.

    Next time, try just taking a Screen Print instead of using a camera.
    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.

  4. #4
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    Sorry for the upside down. First time I have used a attachment.
    Could I select a name in the combo box and have another box to show the address on the customer form. ( the address would come from the company owner form).

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Paul's link describes one method to accomplish that.
    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.

  6. #6
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    I have to have it like a mailing address. I us this data in other forms such as invoices as a nz default value. Before I only had one field that contained the name and address. But I wanted to have a field for each if possible

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    An expression in a textbox can concatenate data.

    Or have separate textboxes arranged one below the other.
    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.

  8. #8
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    I have tried both ways here is the code I used for after update event for the combo box

    private sub company_owners_name_afterupdate()
    me.billing_info = me.company_owners_name.column(2)
    end sub


    i can see the 2 column when selecting the drop down but it does not update the text box

    I think I have something wrong

  9. #9
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    combo box's are 0 based try me.company_owners_name.column(1) if you have 2 fields

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    As trevor said, combobox/listbox column index is 0 based, so column 1 is index 0.

    Are you trying to save the info into record? That is duplicating data.

    To just display the info from combobox, an expression in textbox could be:

    =[company_owners_name].Column(1) & Chr(13) & Chr(10) & [company_owners_name].Column(2)

    Code is only required if need to save to a record.
    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.

  11. #11
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    Thanks that worked great, can I use a string expression in the query to show more than one field

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Expression with concatenation can be done in query.
    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.

  13. #13
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    Thank you Trevor and June. It works great.

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

Similar Threads

  1. Replies: 3
    Last Post: 07-03-2013, 10:38 AM
  2. Replies: 3
    Last Post: 06-09-2013, 05:35 PM
  3. Replies: 1
    Last Post: 10-30-2012, 10:29 AM
  4. Replies: 2
    Last Post: 08-16-2012, 10:02 PM
  5. Replies: 4
    Last Post: 08-16-2011, 05:54 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