Save action on data control not working

A

Andrew

Hi,

I am working through a VB Databases book, and on coding
the following..

Private Sub Data1_Validate(Action As Integer, Save As
Integer)

If Action = vbDataActionDelete then
MsgBox "You may not delete a record!"
Save = False
End If

End Sub

when i run the program, the message box appears, but then
the record still gets deleted??

The book continues by confirming that the record remains
in the Data Grid, however it has gone on mine :-(

Does anyone know what this could be?

The Data Source is saved as Access 97, and I am using
Visual Basic 6

thanks

Andy
 
A

Andrew

Hi again,

I have solved it....sorry, was a bit premature,

I checked out the authors website, and it was covered as
an errata..

It needed Action = vbDataActionCancel after the save =
False which he had omitted in his book.

Just thought I would post incase anyone else experiences
this :)

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top