Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Nadine67 is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2015
    Posts
    55

    Listbox counts one up when saving

    Hello and thank you for any attention this post may receive

    Windows 8.1


    Access 2013

    I have combo boxes on my form with text boxes that auto-populate based upon the selection in the combo box. On the form it works as I want it to - e.g. I select Apples (ID 1 in lookup tbl) and the associated text box populates correctly with seed (col 2 ID 1). However when I exit the form the record in the data table saves as Oranges (ID 2 I lookup tbl) and seed (col 2 ID 1).

    I am stumped as to what is going on. Any suggestions?

    Nadine

  2. #2
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    We need more information about your structure and relationships between the tables and the form.

  3. #3
    Nadine67 is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2015
    Posts
    55
    Hello Andy

    FORM - The RowSource of the cbxVarProd is 'SELECT [ProductType], [UnitType] FROM tblProductDecrease ORDER BY [ProductType];'
    The Control Source of the associated auto populate txtbox is '=[cbxVarProd].[Column](1)'
    There are no associated events which would index the combo box selection. The associated txt box captures the correct information. However the combo box changes to the next option in the list once the form is saved.

    TABLE - has three fields - ProductID (primary key), ProductType, UnitType.
    There are no queries nor relationships with this table.

    I am so confused.

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    can you post a copy of the db
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    For your combo box, what have you set as the bound column property? (It should be 1)

  6. #6
    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
    I suspect that the Combobox is bound to a Field in the underlying Table, and the Combobox, for this type of operation, should be unbound.

    This doesn't mean that there shouldn't be a Bound Column, as per John-G, but that the Control Source Property of the Combobox should be empty.

    Linq ;0)>

  7. #7
    Nadine67 is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2015
    Posts
    55
    Hi John G and Missinglinq

    The ComboBox has a Control Source is a field in the table, Row Source Type is Table/Query and the Bound Column is 0.

    See attached db. The forms in question are 'frmCapture' and 'frmEdit'. The fields in the form are under the heading/tabpage Productivity and Variable Cost. The main data table is tblImprovementIdeas and the tables relevant to the Comboboxs are tblProductIncrease and tblProductDecrease.


    My front-end is greater than the allowed limit of 500.0kb. Is there another way to attach the fe? I have attached the be only.

    TRAIN_be.zip
    Nadine

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848

  9. #9
    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
    Quote Originally Posted by Nadine67 View Post

    The ComboBox has a Control Source is a field in the table, Row Source Type is Table/Query
    Then that is the cause of your problem! As I said, the Combobox, for this type of operation, has to be be Unbound. If you need to save the Combobox selection, you need to add a Textbox to the Form that is Bound to the Field in the Form's underlying Table/Query...the Field that currently populates the Control Source of the Combobox...but the Combobox, itself, has to be Unbound.

    Linq ;0)>

  10. #10
    Nadine67 is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2015
    Posts
    55
    So then the text field will require an AfterUpdate function to equal the value selected int he Combobox?

  11. #11
    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
    Yes, you'd use the AfterUpdate event of the Combobox to assign the Value from it to the Textbox, which in turn would be Bound to the Field in the Form's RecordSource.

    Linq ;0)>

  12. #12
    Nadine67 is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2015
    Posts
    55
    Yes I tried that Orange, but the combine zip was greater than 500kb.

  13. #13
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Did you do a compact and repair on the front end first?

  14. #14
    Nadine67 is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2015
    Posts
    55
    Yes I did and it went from 6.06Mb to 2.46Mb

  15. #15
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Bound Column is 0.
    That's a mistake (and an easy one to make). Setting the bound column to 0 gives you the listindex of the selected item (i.e. which ROW you selected), not a value in one of the columns. This is one time where the column reference is NOT zero-based (don't you just love Microsoft's 'consistency'?), so if you want the value from the first column, the bound column value must be 1.

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

Similar Threads

  1. Replies: 2
    Last Post: 01-31-2016, 08:08 PM
  2. Replies: 3
    Last Post: 04-22-2015, 04:35 AM
  3. Why Are Counts Different?
    By johnywhy in forum Queries
    Replies: 9
    Last Post: 01-08-2014, 05:35 PM
  4. Replies: 1
    Last Post: 09-10-2012, 11:21 PM
  5. too many counts!
    By Svear in forum Access
    Replies: 1
    Last Post: 03-07-2012, 10:14 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