Results 1 to 4 of 4
  1. #1
    RasterImage is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2011
    Location
    UK
    Posts
    25

    Combo box incorrect format


    I have a combo box where user can pick a value from a lookup table, and I'm baffled why I can't get the format right.
    It worked fine until I uploaded my tables to SharePoint lists, that's why I'm posting this here.

    The lookup table has primary key TypePK, (autonumber, as seems to be required by SharePoint). Other fields are TypeCode (double, but all entries are integers) and Description (string).
    The main table has a field Type (long integer) which links to TypePK.
    The combo box looks up TypePK in the lookup table, but shows TypeCode on the form.

    Why is TypeCode showing two decimal places in the combo box, i.e. 1.00 instead of 1?

    Entries show as integers on the row source query.
    I've changed the format of the combo box to General Number and anything else I could think of, with Decimal Places 0.

    I realised that double is not the appropriate data type, so I went to my SharePoint list to change it. Even changing it to text would work. But SharePoint won't let me, it says I can't change the column type because it is 'being indexed'.
    I tried to delete the index, but it goes to a page saying 'the index is being deleted' and stays there forever.

    I don't know much (at all) about SharePoint. If I deleted the list and made a new one with a sensible data type for TypeCode, would I still be able to have all the referential integrity I went to so much trouble to preserve in my current lists?

    A thousand thanks for any tips that might help.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    9,629
    When I read this I think what you have is a lookup field, not a lookup table. If you click in the table field (in datasheet view) and this combo you speak of appears, you don't have a lookup table. You have a lookup field. That is not recommended, and that is where your index really lies. Problem is, you can't see the index or the underlying table that this design creates without you knowing about it. If I'm right, see
    The evils of lookup fields - http://access.mvps.org/access/lookupfields.htm

    If not, I misunderstood and would have to re-think.

    EDIT - OK now I think it's not a lookup field.
    Why is TypeCode showing two decimal places in the combo box, i.e. 1.00 instead of 1?
    I guess you mean on the form. Since you have set decimal places to 0 I'm afraid I'm out of ideas, except to suggest deleting the control and creating a new one. Never used Sharepoint much. Did you set decimal places in the table field as well?

    Type is a reserved word. Suggest you don't use it for any objects

    http://www.allenbrowne.com/AppIssueBadWord.html
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  3. #3
    RasterImage is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2011
    Location
    UK
    Posts
    25
    I added lookup fields for all my relationships even though I don't like them.
    This is because I was following these instructions for making my tables suitable for SharePoint. https://answers.microsoft.com/en-us/...6-1741aacd6ea3

    Is that not right? Did I not need to do that?

    I have tried deleting the control and adding again. I have set decimal places to 0 everywhere I can. I changed the names of fields with "Type" in them. No joy yet, but thanks for suggestions.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    9,629
    Sorry, SP is out of my realm of experience. About all I can say is if you investigate the all of the table fields and controls in both SP lists or native tables where TypeCode appears and they are formatted suitably then I'm left with asking why TypeCode is a double when you're only entering integers. Wouldn't Long or Integer automatically exclude the decimal point?
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

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

Similar Threads

  1. Looping Is Incorrect
    By DMT Dave in forum Access
    Replies: 14
    Last Post: 07-11-2021, 07:45 PM
  2. Replies: 7
    Last Post: 07-03-2018, 09:33 AM
  3. Combo box is recognized as digit format
    By Gealeks in forum Forms
    Replies: 8
    Last Post: 11-27-2013, 03:08 PM
  4. Replies: 14
    Last Post: 07-19-2011, 04:00 PM
  5. Incorrect Values Populating My Combo Boxes
    By charlyzaingel in forum Forms
    Replies: 19
    Last Post: 06-23-2011, 10:17 AM

Tags for this Thread

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