Results 1 to 5 of 5
  1. #1
    tdoolittle is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2014
    Posts
    18

    Datasheet View Form - New Records Changes All Existing

    I'm very confused and even more confused on how to explain this, but here we go!

    I have a form that consists of two combo boxes. Each combo box is controlled by a query to limit its choices. When you make a selection from the first combo box, the second combo box populates with the second column from the first combo box. It all works fine and dandy. Now I want this to be in a datasheet view. It allows the user to feel familiar with their existing spreadsheet, they simply hit a dropdown, pick an item name, its serial number autopopulates and they can move on... but not really.

    When you go to add a second record on the form, your selection for ColumnA changes the existing ColumnA selection. And I have no clue why. To try to explain more, here is an example of what I would want a quick finished sheet to look like:

    SKU SERIAL
    Canon 100mm F2.8 USM MACRO X0004II9CH
    Canon 50mm F1.2L USM EF Lens X0004II9CR
    Canon 50mm F1.4 USM X0004II9DB
    Canon 60mm EF-S F2.8 USM X0004II9DL
    Canon 70-200mm F4L USM X0004II9DV

    Pretty simple, add a product, and then another, and then another. But here's what the same completed sheet would look like made right now:



    SKU SERIAL
    Canon 70-200mm F4L USM X0004II9CH
    Canon 70-200mm F4L USM X0004II9CR
    Canon 70-200mm F4L USM X0004II9DB
    Canon 70-200mm F4L USM X0004II9DL
    Canon 70-200mm F4L USM X0004II9DV

    The next product to be selected overrides all the other selections in the column. But notice all the serials stay unique to the original item selected, but the SKU changes to match the new SKU chosen for the new record. I'm not sure what would cause this, the only code I have triggering is an "On Change" event that triggers when you select a SKU. The even being that when you select a SKU, the serial number field autopopulates.

    Any ideas as to what might be causing this to happen??

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Is the SKU combobox bound to field? An unbound control will show the same value for all instances of the control.

    If you want to provide db for analysis, follow instructions at bottom of my post. Identify objects involved.
    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
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    As June7 suggested, the Control that holds the data for the SKU Field must be Unbound, in order for this behavior to occur. In order for the Field to be Record-appropriate, it must be Bound to a Field in the underlying Table/Query.

    While you look at the Form and see X number of SKU Controls, there is, in reality, only one SKU Control! What you are seeing are multiple instances of that single Control. To fix this, in Form Design View:

    • Select the Combobox
    • Go to Properties - Data
    • In the Control Source Property select the Field in your underlying RecordSource that will hold the SKU selection

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    tdoolittle is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2014
    Posts
    18
    Sorry for my late reply, but vacation came early this year! It was Unbound... totally my fault, and now fixed and running! Thank you both!

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Glad we could help!

    Good luck with your project!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 3
    Last Post: 08-18-2013, 09:14 PM
  2. Replies: 2
    Last Post: 05-15-2013, 09:03 PM
  3. Replies: 6
    Last Post: 11-21-2012, 05:10 PM
  4. Replies: 16
    Last Post: 09-12-2012, 08:39 AM
  5. Replies: 1
    Last Post: 12-18-2011, 01: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