Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    revnice is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    61

    get name where number =

    I've got a combo box in a form that lets me choose the Customer.

    Once I choose the customer, I want the other two fields to auto-populate from the same table (see pic).



    trb1560 actually did this for me in my initial post but when I click (...) to see what he did, Access crashes.

    Presumably, I need to add the correct criteria to the query? I can't have 'where number = 0003' i.e. a specific number because the number won't be known until the combo box looks it up.

    Can anyone tell me what that criteria should be - and where to put it

    Thanks - rev



    Thanks - rev

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What do you have as the RecordSource of your form?

  3. #3
    revnice is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    61
    CUS_ID for the CUS_ID field - and it selects the ID and Name and shows me both in the combo box. That works fine, but it doesn't populate the other fields.

    That's what I need to know.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try using the ComboBox wizard to create another ComboBox and this time select #3 option.

  5. #5
    revnice is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    61
    I'm off to try it, thanks.

  6. #6
    revnice is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    61
    If by 'third option' you meant:

    *Queries
    *Tables
    *Both (3)

    I checked Both but it made no difference on its own. Maybe there's something else I have to do once that's checked?

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    When you create a ComboBox with the wizard the wizard starts off by asking you what you want your ComboBox to do. Select the 3rd option.

  8. #8
    revnice is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    61
    I selected the third option and now CUS_NUM appears in the NAME1 field. See pics.

    I can't choose CUS_ID as the record source for CUS_ID because it doesn't appear in the list! What's going on?

    Can somebody spell it out for me, I've been on this for days!

    Thanks - rev

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The ComboBox cannot be bound for it to work properly.

  10. #10
    revnice is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    61
    It's Unbound and still doesn't work properly.

    Why isn't CUS_ID available as the RecordSource? I was getting it yesterday but I don't remember doing anything different.

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Your ComboBox should *not* have a control source but the other two TextBoxes should have a control source. Do they?

  12. #12
    revnice is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    61
    Yes they do, they contain the correct column for the source of the data.

  13. #13
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    They need to point to a field in the RecordSource of the form. Use the cbo in the property to select the correct field.

  14. #14
    revnice is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    61
    See pic3 above. Is that where you mean?

    If that's where you specify the field, it's already there Name1 and Name2 for each form field respectively.

  15. #15
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Nope! That's in the property sheet of the ComboBox and not done properly I might add. You need to look at the property sheets of both TextBoxes.

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

Similar Threads

  1. Making New Record Number Next Numerical Number
    By jhillbrown in forum Access
    Replies: 1
    Last Post: 03-10-2010, 11:06 AM
  2. Sort by even or odd number
    By sammer021486 in forum Queries
    Replies: 7
    Last Post: 11-23-2009, 12:30 PM
  3. Invoice number
    By slik_02 in forum Access
    Replies: 3
    Last Post: 08-08-2009, 08:05 AM
  4. Replies: 1
    Last Post: 03-12-2009, 09:55 AM
  5. Sum Of Positive Number and Negative Number
    By maysamab in forum Reports
    Replies: 1
    Last Post: 10-20-2008, 04:06 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