Could someone please suggest a way I can get the following sub to work? I'm trying to check to see if a field in a datagrid has been changed. I get runtime error 424 Object Required.
Thanks

[Private Sub DbGrid1_BeforeUpdate(Cancel As Integer)
If DBGrid1.Columns(1).Value.DataChanged = True Then ' Check for change in data.
MsgBox "field changed."
End If
End Sub ]

Re: testing for datachanged in datagrid 80 80

Could someone please suggest a way I can get the following sub to work? I'm trying to check to see if a field in a datagrid has been changed. I get runtime error 424 Object Required.
Thanks

[Private Sub DbGrid1_BeforeUpdate(Cancel As Integer)
If DBGrid1.Columns(1).Value.DataChanged = True Then ' Check for change in data.
MsgBox "field changed."
End If
End Sub ]

I figured it out. This is the solution:
[If DBGrid1.DataChanged = True Then ....]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.