Results 1 to 3 of 3
  1. #1
    zipmaster07 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    22

    Combo Box on form updates unintentionally

    I have a simple form that pulls off of a table called contractors. This table has infomation relating to a contractor like the contractor_name and contractor_id. On the form is a subform that pulls off a table called leads. The subform pulls all the leads where the contractor_id is the same as the one that is currently being looked at on the main form. Instead of using the built-in record selection tool that is at the bottom of every form I put a combo box that lists all the contractors so that you just select the contractor you want to see from the drop down by contractor_name. It brings up the the record and its corresponding data just fine, however when you choose one record from the drop down and then choose another record it overrights the contractor_name field on the actual table and sets it to the contractor_id of the record you just selected.

    For example given the following

    ============================
    | contractor_id | contractor_name|
    ------------------------------------


    | 1000 | Contractor A |
    | 1050 | Contractor B |
    | 1100 | Contractor C |
    ============================

    If I choose Contractor A the form pulls up all the leads assoicated to Contractor A, however, once I'm done looking at Contractor A if I decide to look at Contractor B and select them from the drop down it updates, or rather changes, the contractor_name field of Contractor A to 1050 (because that was the ID of the record I just went to) so the updated table now looks like this:

    ============================
    | contractor_id | contractor_name|
    ------------------------------------
    | 1000 | 1050 |
    | 1050 | Contractor B |
    | 1100 | Contractor C |
    ============================

    As I continue to select more and more records from the drop down it continues to overright more and more contractor names.

    I don't want the form to update anything, I just want to select the contractor from the drop down and have it display the rest of the form based on that selection. I tried changing a few update related settings on the Property Sheet of the combo box but this didn't change anything so I'm apperantly still missing something or not changing the right property.

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Data controls (textbox, combobox, listbox) used as input for search/filter criteria should NOT be bound - nothing in ControlSource property.
    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.

  3. #3
    zipmaster07 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    22
    Thanks, working exactly the say I want it now.

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

Similar Threads

  1. Form no longer updates table; what'd I do?
    By SevenSignz in forum Forms
    Replies: 8
    Last Post: 03-04-2012, 12:25 PM
  2. Tracking Log of updates in a form
    By cin324 in forum Access
    Replies: 9
    Last Post: 11-30-2011, 01:12 PM
  3. Form text box updates for all records
    By AndrewsPanda in forum Forms
    Replies: 13
    Last Post: 09-28-2011, 11:31 PM
  4. Inquiry form updates the current record
    By mazzanrol in forum Forms
    Replies: 4
    Last Post: 04-08-2011, 08:35 AM
  5. Replies: 2
    Last Post: 03-29-2010, 11:52 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