Results 1 to 11 of 11
  1. #1
    rkm360 is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2009
    Posts
    6

    ComboBox with multiple columns

    Hi everyone, I need some help (obviously!)



    I have a simple database for entering sample requests.

    In my sample request entry form (tblSampleOrders) I have a combobox that selects from a table with our sales reps information (name, phone & e-mail.)

    What I can't seem to figure out seems like it should be very simple:
    When I choose a given sales rep in the combo box, how can I copy the two additional fields in the table to two additional fields on the entry form?

    i.e...I choose Sales Rep Norm from the combo box. This then copies the saved phone & e-mail for Norm to the Phone & E-mail fields on the Entry form. This information would be saved in the tblSampleOrders fields named RequestedByPhone & RequestedByEmail.

    I found another post in this forum that seemed to be on the right track, but when I installed the code it did not work:

    AfterUpdate_RequestedBy combo box
    Me.SalesRepEmail = Me.RequestedBy.Column(1)(zerobased)
    Me.SalesRepPhone = Me.RequestedBy.Column(2)(zerobased)

    I appreciate any help you can offer!

  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,641
    It looks like you're on the right track. Make sure the fields are included in the combo row source and that the combo's Column Count property is correct.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    rkm360 is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2009
    Posts
    6
    I double-checked both, fields are included in the row source and the column count is correct. Still no luck though! I don't get any errors or anything, it just doesn't work yet....

  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,641
    Can you post the actual code, or the db itself?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    rkm360 is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2009
    Posts
    6
    I'd be happy to send you the DB, but would prefer to send PM if possible.

  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,641
    That's fine.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    rkm360 is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2009
    Posts
    6
    I don't think I can attach something to a PM, and it is slightly too big to attach to a post. I'm sorry! Can I send it to you directly?

    Thanks again,
    Robert

  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,641
    Sure

    removed
    Last edited by pbaldy; 05-06-2010 at 10:19 PM. Reason: delete email addy
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    For starters, the "ZeroBased" bit can't be there. Second, there is no control named "SampleID_SalesRepEmail". Third, it looks like you just typed in the code; it's not associated with the control and the control name is misspelled. If I correct all that, this works:

    Me.CustomerE_Mail = Me.RequestedBy.Column(2)

    If you're not familiar with how to associate the code:

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

  10. #10
    rkm360 is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2009
    Posts
    6
    Paul, thank you very much! I am sorry for not responding I did not get notice that you had answered this already last week. Thank you for your time, it works perfectly now and is exactly what I needed!

    Regards,
    Robert Monroe

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Happy to help, Robert. Glad we got it working.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 02-05-2010, 08:33 AM
  2. Lookup Columns Multiple Records in report
    By schultzy in forum Reports
    Replies: 1
    Last Post: 01-02-2010, 12:21 AM
  3. Consolidate multiple columns into one
    By COforlife in forum Access
    Replies: 17
    Last Post: 10-19-2009, 01:12 PM
  4. Combo Box with multiple columns
    By desireemm1 in forum Access
    Replies: 1
    Last Post: 08-17-2009, 02:36 AM
  5. Multiple Price Columns
    By kmwhitt in forum Access
    Replies: 0
    Last Post: 04-04-2009, 09:48 PM

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