I want to put some checkbox in datarepeater and bind them with the field in database. In user control project, I code like this:
--------------------------------------------------------------------------------
Public Property Get Discontinued() As String
Discontinued = ChkDiscont.Value
End Property
Public Property Let Discontinued(ByVal newDiscontinued As String)
ChkDiscont.Value = newDiscontinued
PropertyChanged "Discontinued"
End Property
Private Sub ChkDiscont_Click()
PropertyChanged "Discontinued"
End Sub
--------------------------------------------------------------------------------
After creating my user control and setting the RepeatedControlName, I add RepeaterBinding objects as following :
-------------------------------------------------------------------------------
With Repeater
Set .DataSource = Adodc1
.RepeatedControlName = "ProductsCtl.ctlProducts"
.RepeaterBindings.Add "ProductName", "ProductName"
.RepeaterBindings.Add "Discontinued", "Discontinued", 4 << Error occur at this statement. (Field type in user control is checkbox).
End With
-------------------------------------------------------------------------------
But when I run program, the error " Type Mismatch " occur.
I try to solve this problem in many way but it still don't work.
Can anyone help me ??
--------------------------------------------------------------------------------
Public Property Get Discontinued() As String
Discontinued = ChkDiscont.Value
End Property
Public Property Let Discontinued(ByVal newDiscontinued As String)
ChkDiscont.Value = newDiscontinued
PropertyChanged "Discontinued"
End Property
Private Sub ChkDiscont_Click()
PropertyChanged "Discontinued"
End Sub
--------------------------------------------------------------------------------
After creating my user control and setting the RepeatedControlName, I add RepeaterBinding objects as following :
-------------------------------------------------------------------------------
With Repeater
Set .DataSource = Adodc1
.RepeatedControlName = "ProductsCtl.ctlProducts"
.RepeaterBindings.Add "ProductName", "ProductName"
.RepeaterBindings.Add "Discontinued", "Discontinued", 4 << Error occur at this statement. (Field type in user control is checkbox).
End With
-------------------------------------------------------------------------------
But when I run program, the error " Type Mismatch " occur.
I try to solve this problem in many way but it still don't work.
Can anyone help me ??