Results 1 to 6 of 6
  1. #1
    vector39 is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    May 2017
    Posts
    76

    Changing 0 to -1 to Yes/No

    Hi everyone



    I have a list box that displays either yes or no based on a combo box I have on another table. I also have a text box set to that specific column and on the list box (e.g. =listData.Column(2)), each row in the list box appears as either yes or no but on the text box the values are either 0 or -1. How can I make the text box display the same as the list box (yes or no)?


    Thank you!


  2. #2
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You don't say what data type you're dealing with. Just because values are yes/no doesn't necessarily mean the type is Boolean.
    On the format row of the property sheet for the textbox, try choosing one of the drop down formats that suits you. True, yes, on are near the bottom of the list.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    vector39 is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    May 2017
    Posts
    76
    In the table, the column is a yes/no data type and the display control is set as a combo box, i notice on the table when i click the dropdown, the options yes and no are visible but say for example you select "yes" then click off yes appears in the row, but once you clock back onto the row "-1" is visible. It changes from "yes" to "-1" as you click on and off. I tried doing what you suggested on the format row of the property sheet for the text box but it still comes up as -1 or 0.

  4. #4
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    It changes from "yes" to "-1" as you click on and off.
    If you're talking about what you see when clicking on and off a field value in a table, this does not matter. The drop down chooses which format to display for the field value. Clicking on the data exposes the actual value. I imagine that if the table is set to yes/no, the listbox would display yes/no, and since the textbox is calculated, the expression should be
    =IIf (list2.column(1),"YES","NO")
    This all presumes you understand that listbox column reference starts at 0 and the fact that you're using (1) is not why you're getting the wrong value. I think not but just wanted to cover that possibility.

    I removed the [ brackets because for some reason, the first one caused a line wrap no matter what I did. Code tags didn't help, nor did copying/pasting to/from Notepad.

  5. #5
    vector39 is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    May 2017
    Posts
    76
    Thank you. That did the trick.

  6. #6
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You're welcome. Don't forget to mark your thread as solved.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Changing the display possible?
    By ayupchap in forum Access
    Replies: 11
    Last Post: 10-31-2016, 08:57 PM
  2. Changing a Macro into VBA
    By Lou_Reed in forum Access
    Replies: 3
    Last Post: 07-20-2016, 01:43 PM
  3. Changing iff into VBA code
    By masond in forum Access
    Replies: 1
    Last Post: 02-21-2014, 08:28 AM
  4. Changing VBA to do more
    By data808 in forum Programming
    Replies: 1
    Last Post: 02-03-2014, 02:29 AM
  5. Changing row source
    By joacro in forum Access
    Replies: 3
    Last Post: 03-06-2011, 07:35 PM

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