Results 1 to 8 of 8
  1. #1
    mp3909 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    136

    Why my column defaults to Number when it is a text

    Hi,



    I have this table:

    Click image for larger version. 

Name:	Capture.jpg 
Views:	20 
Size:	155.4 KB 
ID:	42276

    As you can see, the Data type of the field risk_input is showing as a Number.
    But when you view the results of the table, it is a text.

    Click image for larger version. 

Name:	Capture.jpg 
Views:	21 
Size:	150.6 KB 
ID:	42277


    How can I get the Data type of this field to not default to number and instead text?

    Thanks

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    Because you are using lookup in the table , so you see the second column(text) but store the first(Number)
    Would strongly advise against using look-ups in the table. See: http://access.mvps.org/access/lookupfields.htm
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    mp3909 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    136
    So if I wanted to fix this, are you saying I need to change the bound column and column count?

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    Quote Originally Posted by mp3909 View Post
    So if I wanted to fix this, are you saying I need to change the bound column and column count?
    If you just change the "Display Control" setting to Text Box, I think that would be sufficient.
    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
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    BTW

    ID is not a good name for a field. ProdID or ProductID would be better. I assume this will be the Primary Key for the table but even if it weren't, it could soon get confusing when used in queries with other tables if they also have their Primary Key named "ID".
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    mp3909 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    136
    It won't allow me to change the display setting to text box.

  7. #7
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    Quote Originally Posted by mp3909 View Post
    It won't allow me to change the display setting to text box.
    It believe it will. It's one of the three setting available from the dropdown arrow on the far right of the setting which is on the Lookup tab
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    The field will still be number type because that is what is actually getting saved.

    Changing to a textbox allows viewing actual value when table is open. Certainly should allow changing.
    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.

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

Similar Threads

  1. Replies: 1
    Last Post: 02-05-2015, 08:12 AM
  2. Replies: 5
    Last Post: 11-12-2014, 09:17 AM
  3. Filter data by number as text column.
    By msadiqrajani in forum Access
    Replies: 14
    Last Post: 08-15-2012, 02:34 PM
  4. Replies: 2
    Last Post: 07-21-2012, 01:21 AM
  5. pulling text values into FK number column
    By REBBROWN in forum Database Design
    Replies: 2
    Last Post: 08-30-2010, 05:04 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