Checkbox and datagrid

dr223

Registered User.
Local time
Today, 15:04
Joined
Nov 15, 2007
Messages
219
Hallo,

I have a checkbox which I called ToPay (design name), this checkbox is unbounded with other bounded fields in a datagrid called DgvToPay.

Also note, When the form is loaded the datagrid is populated and the checkbox checked always (i.e,. threestate set to True).

What I want to do is when Checkbox (3rd Column) is unchecked the respective AmounttobePaid field (4th Column) is set to £0.00. Instead of what is displayed on the datagrid.

Please could you tell me the coding and where to insert the code.

Thank you very much
 
In the after_update event of your checkbox3 use something like this:

Code:
Private Sub chk3_AfterUpdate()
    If (Me.chk3 = True) Then
        Me.AmounttobePaid = 0
        Else
        'do nothing
    End If
End Sub

Replace Me.chk3 with the NAME of your checkbox in "column 3"
If you want to undo the change this can't be used, the change is permanent for Amounttobepaid the instant you click in the checkbox.

JR
 
Is this in VB.net 2005. Because i wanted to change the desin name to Me.chk3 but it says Me.chk is not a valid identifier.

I named it ToPay before

Thanks
 
Didn't see that you posted in VB.net, in access ME is a short refrence to controls on the form. I don't know much about VB.net

JR
 

Users who are viewing this thread

Back
Top Bottom