Database Warnings

Mmccl

Enough to be Scary
Local time
Today, 07:47
Joined
Nov 26, 2003
Messages
43
Help - I'm Able to Delete Records without Warning

What is happening? I use Access 2002 (xp) with a 2000 DB format.

I have a form that has been woring well since it's creation about 10 months ago. It has a control button on it to delete the current record. If I clicked this button in the past, I got a deletion confirmation box before the record would delete.

I created the delete button control using the wizard.

OK so Far

Now I have added a few more controls to send email thru Outlook Express and have been doing some basic form improvements . . .

. . . BUT now the delete button control has a mind of it's own!

Now when I click it, it just deletes the record without any further warning.

If I go to the table, and try to delete a record, it warns me.

If I create a new form, based on the same query as my origenal form (but with much fewer controls and fields) the delete button prompts for confirmation - works fine

What did I do - this is freaking me out.

Have spent hours now trying to undo everything I did as far as updates go since the control last worked correctly - and nothing.

Have created a new control, In the offending form, but still just deletes at will

Help please
Mike
 
Is it possible you have turned the warnings off within your code and forgot to turn them back on?

DoCmd.SetWarnings False 'turn warnings off
'your code
DoCmd.SetWarnings True 'turn warnings back on

You need to ensure your error handlers turn the warnings back on just in case a function errors while the warnings were turned off.

HTH
 
I did that

I remember deleting error handlers in the code, but I don't remember where they were... ie under which controls.

where does this corrction go in the code

Another problem I am a having with the delete control. it seems to be some what random.

Even in my older copy of the database, that i thought was working find. It has 215 records. as I go thru and start deleting records, it will warn for most, but not all.

???
 
I am missing error handlers for sure
after creating a form that had several fields and just a delete button, i deleted all the records and was warned for every one.

So in may master form, I am missing some error handlers. The random behavior I mentioned before must be due to the various conditions in the form.

But where do error handlers go. Is there one I can set that will do the whole form??

or should each sub just have it's own error handler, like:
_____________________________
Exit_Command20_Click:
Exit Sub

Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click
_____________________________

Thanks
mike
 

Users who are viewing this thread

Back
Top Bottom