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?
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.