Solved

DBGrid_ BeforeUpdate

Posted on 1998-03-25
3
420 Views
Last Modified: 2008-03-10
Hi!
This is my problem:
I use a dbgrid and in dbgrid_beforeupdate I validate my
data .
if X="" then
 msgbox "Please do something!!"
 cancel=True
 exit sub
end if
At runtime after this message I see another dbgrid message
like this;
"This action was cancelled by an association object."
How can I cancel this message?
0
Comment
Question by:nima
3 Comments
 
LVL 6

Expert Comment

by:clifABB
ID: 1459783
I've run across this problem on many occassion.  The only way I've found to solve this was to set DBGrid.DataChanged = False with the Cancel = True.
0
 

Author Comment

by:nima
ID: 1459784
I'm sorry but it didn't work.
0
 

Accepted Solution

by:
girsu earned 50 total points
ID: 1459785
This masseg box comes form DBGrid Errors yocan please this code in your app. and check.

Private Sub dbGrid1_Error(Index As Integer, ByVal DataError As Integer, Response As Integer)
    If DataError = 16389 Then
        Response% = vbDataErrContinue
    End If
End Sub

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Macro which automatically sends attachment to Outlook 14 61
Visual Basic Excel Formatting error 4 83
Spell Check in VB6 13 95
MsgBox 4 45
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now