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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set the Let and Get Properties for a Check box in ActiveX Control 1

Status
Not open for further replies.

Oliver2003

Technical User
Apr 19, 2003
144
GB
I am displaying a recordset using the data repeater control; I have created an ActiveX Control that has various text boxes and one Check box.

The Text boxes display fine, but the Check box does not display any info from the recordset, the code I am using is:

Public Property Get ElectronicDocument() As String
ElectronicDocument = chkElectronicDocument.Value
End Property

Public Property Let ElectronicDocument(ByVal newElectronicDocument As String)
chkElectronicDocument.Value = newElectronicDocument
End Property


which is what I had been using for the text boxes.
It is set up in Procedure Attributes as "Property is data bound" and "Show in databindings at designtime"

Any Ideas how to get this d to display info from the recordset.

Cheers.
 
There may a problem with assigning a string to a checkbox. That is, VB may convert the string to the suitable value in a way that you don't expect, or chucking an error that is being handled elsewhere.


Maybe ensuring that the conversion is done as you expect might be a good start.

maybe something like (I don't knwo what your DB is returning but I assume Yes or No)
Code:
Public Property Let ElectronicDocument(ByVal newElectronicDocument As String)
    chkElectronicDocument.Value = iif(newElectronicDocument = "Yes", vbChecked, vbUnchecked)
End Property

and something similar for the get property

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Matt, thanks for the reply - I was using a Yes/No check box field in the db - At first it diddent work, so I change "Yes" to True and it works.

Thanks for your help
Oliver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top