Displaying 0/1/Null data as checkbox on Form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alana001
    New Member
    • Mar 2008
    • 2

    Displaying 0/1/Null data as checkbox on Form

    I'm sure this is incredibly simple, I just haven't been able to find the magic search string for Google. :)

    The basic question is: What VB function do I use to update the value of a text box each time the user goes to the next record?

    --

    In my database I have a field where they have stored 0's and 1's (or nothing) for whether or not a person has a certain job skill. The users of my form will not be updating this data, only looking at it to see a person's skills. For ease of reading, I was hoping to instead of displaying something like:

    Microsoft Office: 1

    Display:

    Microsoft Office: Yes

    I believe I've figured out the simple VB code to do this, my problem is I'm not sure where to put this block of code.. TextBox_BeforeU pDate() doesn't update, it stays empty. Form_Load() does what I want it to, but only for the very first record. What VB method would update this text box every time the user changes the record?
  • alana001
    New Member
    • Mar 2008
    • 2

    #2
    I believe I found what I was looking for--Current() seems to go off each time the record changes. :) Working as I wanted it to now.

    Comment

    • Stewart Ross
      Recognized Expert Moderator Specialist
      • Feb 2008
      • 2545

      #3
      Originally posted by alana001
      I believe I found what I was looking for--Current() seems to go off each time the record changes. :) Working as I wanted it to now.
      Hi Alana. There is a much simpler way to do what you wanted to do without using a form event at all, and this is to use the Format property of the field. To show "Yes" in place of any positive value, "No" for any zero, and "-" for any nulls, place the following in the format property of the text box on your form:
      Code:
       "Yes";"";"No"; "-"
      There are four sections in the format property for numbers: formatting for positive values, negative values, zero values, and nulls. The format property goes beyond simply how the value is displayed to making substitutions (as shown) and text colour changes.

      -Stewart

      Comment

      Working...