schoon
asked on
DBGrid: This Action was Cancelled by an Associated Object
I am editing data entered into a DBGrid. When the data is bad I set Cancel to true in DBGrid_BeforeUpdate. OK so far. However I always get the "This Action was Cancelled by an Associated Object" message when I do this (title of messagebox = "DBGrid"). I cannot get rid of this message. The closest I have come to this is in the DBGrid_Error event when VB tells me the DataError parameter = 13689 (Err.Number = 0). I tried setting this to zero but I still get the message. Help!!!!!!!!! TIA, Ed.
My GOD!!!
It was happening to me all the time back then when I programmed in VBasic.
If I remember I've ended up the winner.
I chaged the names of all the objects in the same frame that referred to or had the same Name as the Data Control, except, of course THE DATA CONTROL!!!
Also, I trashed some code about the data control control that was not essential.
The damn message has disappeared!
Hope it works, good luck!
It was happening to me all the time back then when I programmed in VBasic.
If I remember I've ended up the winner.
I chaged the names of all the objects in the same frame that referred to or had the same Name as the Data Control, except, of course THE DATA CONTROL!!!
Also, I trashed some code about the data control control that was not essential.
The damn message has disappeared!
Hope it works, good luck!
My GOD!!!
It was happening to me all the time back then when I programmed in VBasic.
If I remember I've ended up the winner.
I chaged the names of all the objects in the same frame that referred to or had the same Name as the Data Control, except, of course THE DATA CONTROL!!!
Also, I trashed some code about the data control control that was not essential.
The damn message has disappeared!
Good Luck.
Badder.
Hope it works, good luck!
It was happening to me all the time back then when I programmed in VBasic.
If I remember I've ended up the winner.
I chaged the names of all the objects in the same frame that referred to or had the same Name as the Data Control, except, of course THE DATA CONTROL!!!
Also, I trashed some code about the data control control that was not essential.
The damn message has disappeared!
Good Luck.
Badder.
Hope it works, good luck!
ASKER
fguerreiro_inix: It's bound.
Badder: I only have the grid and the datacontrol on the form.
Here's where I'm doing the editing:
Private Sub dbgComments_BeforeUpdate(C ancel As Integer)
Dim sPassDate As String
sPassDate = dbgComments.Columns(2).Tex t
dbgComments.Columns(2).Tex t = gfs_VerifyDate(sPassDate)
If Not basGeneral.DateValid = True Then
MsgBox "Invalid Date", 48, "Error Message"
Cancel = True
Exit Sub
End If
If dbgComments.Columns(2).Tex t = "" Then
MsgBox "You must enter a date"
Cancel = True
Exit Sub
End If
dbgComments.Columns(0).Tex t = CStr(m_SSN)
dbgComments.Columns(1).Tex t = m_StDt
Exit Sub
End Sub
Badder: I only have the grid and the datacontrol on the form.
Here's where I'm doing the editing:
Private Sub dbgComments_BeforeUpdate(C
Dim sPassDate As String
sPassDate = dbgComments.Columns(2).Tex
dbgComments.Columns(2).Tex
If Not basGeneral.DateValid = True Then
MsgBox "Invalid Date", 48, "Error Message"
Cancel = True
Exit Sub
End If
If dbgComments.Columns(2).Tex
MsgBox "You must enter a date"
Cancel = True
Exit Sub
End If
dbgComments.Columns(0).Tex
dbgComments.Columns(1).Tex
Exit Sub
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Brilliant! It works! You, sir, are a genius. Thanks a bunch.
thanks a lot it works superb
thanks a lot
please let me knwow how can u not allow the user to edit 3 columns out of 5 please help
thanks a lot
please let me knwow how can u not allow the user to edit 3 columns out of 5 please help
Are you using bound or unbound mode?