Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Posts
    2

    Question Unanswered: Converting Column value to txt

    I am displaying records from an MS Access Database. One of the fields is the person's marital status. To conserve on space, I have saved it as a short Int: 0=Unknown, 1=Single, 2=Married...etc. What I'm trying to do is convert that numeric value to the textual value when it is displayed in the DatagridView. I am toying around with some ideas but they all seem too time consuming. Does anyone have any ideas on how to go about this?

  2. #2
    Join Date
    Jan 2007
    Location
    California, USA
    Posts
    520
    two ways, the better way first. (my opinion)
    Build a table that has the number, 0, 1, 2, etc as it's key, then the description, Unknown, Single, Married as the next field. Table could be named tblMaritalStatus, the two fields MaritalID, and MaritalText. Then, on the form that will be displaying this status, you would use a combo box rather than a text box. I believe the combo box wizard would walk you through setting the properties for the combo box correctly for this situation.

    Second way, good but not the best.
    Again, use a combo box, but rather than having a table to supply the values and text, you can specify "Value List" in the Row Source Type for the combo box. Then in the row source you would put 0, unknown, 1, Single, 2, Married. Again, the wizard should help you with this approach too.

    HTH,

  3. #3
    Join Date
    Mar 2007
    Posts
    2

    Smile From Richard

    Thanks for the info! I'll give it a shot in the morning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •