Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Apr 2009
    Posts
    114
    Thanks
    18
    Thanked 0 Times in 0 Posts
    Hello
    I think what I'm asking can be done I just haven't found the solution yet. In my form I have a Customer ID field and I would like the associated Company Name for that ID to automatically populate in my form when the ID is entered and I'm using Access 2003.

    Thanks for any assistance you can provide.

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    [quote name='MOSTATE' post='797732' date='13-Oct-2009 10:36']Hello
    I think what I'm asking can be done I just haven't found the solution yet. In my form I have a Customer ID field and I would like the associated Company Name for that ID to automatically populate in my form when the ID is entered and I'm using Access 2003.

    Thanks for any assistance you can provide.[/quote]
    There are several ways of doing that depending on your database design and the form you are using. One common technique is to use a drop-down combo box which hides the Customer ID and displays the list of Company Names, and the user chooses based on the name, not the Customer ID. Another way is to use an unbound text box and use the DLookup function to display the Company Name once the Customer ID has been entered - but that may well involve VBA. A third way is to base your form on a query which contains both the CustomerID and the Company Name, and simply bind the controls to the appropriate field in the query. If you want further assistance on any of those approaches, post back and someone can guide you through the details.
    Wendell

  3. #3
    2 Star Lounger
    Join Date
    Apr 2009
    Posts
    114
    Thanks
    18
    Thanked 0 Times in 0 Posts
    Wendell
    Thanks for the quick reply. I would be more interested in the last option since my form is based on a query that has both fields. If someone could walk me through that I would be most appreciative.

    Thanks!!

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    OK - the first question: Is your form bound to a data source? To determine that, look in the Record Source in the properties for the form. Assuming it is, and that you have navigation controls, then you should be able to put text boxes on the form that display both the CustomerID and the Company Name, and be able to step through the records in the query and see both values displayed. If you want to do navigation to a specific record, then you have additional choices. One is to make the form a subform on a main form where you select a customer based on a combo box or other input. The second is to use the combo box wizard to go to a specific record - that's one of the choices when you create a new combo box using the wizard. The third choice is to apply a filter to the form, based on a navigational control, which requires either macros or VBA. To provide more advice, we would need to see a sample database with a few records. Hope this helps.
    Wendell

  5. #5
    2 Star Lounger
    Join Date
    Apr 2009
    Posts
    114
    Thanks
    18
    Thanked 0 Times in 0 Posts
    I am attaching a sample database. In my form I would like the DeptName to automatically update when the Deptcode field is populated. Please let me know if I need to explain more clearly.

    Thanks in advance!!
    Attached Files Attached Files

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I'd create a combo box for the department code. No code is needed. See the attached version.
    Attached Files Attached Files

  7. #7
    2 Star Lounger
    Join Date
    Apr 2009
    Posts
    114
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Exclamation

    Hans you are AWESOME!! Thanks so much. I do appreciate your help so much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •