Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access .mdb and vb6 for yes/no value

Status
Not open for further replies.

pe

Technical User
Aug 8, 2001
31
0
0
US
I have an access 2000 mdb and a vb6 application that connects to it using ADO. I want to show the "postponed" field from my mdb in my vb6 form but it won't check or uncheck the checkbox according to the different records in the mdb. this is my code...

chkPostponed.Value = rsProj!Postponed

Also, i have an input form in vb6 that uses rsProj!Postponed = chkPostponed.Vlaue

Neither work. What am I missing? Thank you very much
 
You would probably need to use an If..then..else or Select case structure for this. The CheckBox control has 3 different values you can assign to it (unchecked, checked, greyed) not just a simple True/False that your Access database field would have.
Code:
If rsProj!Postponed = "True" Then
     chkPostponed.Value = vbChecked
Else
     chkPostponed.Value = vbUnchecked
End If
Hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top