Setwarnings On

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Cannot figure out how to turn on setwarnings... Any clue? Also for some reason the table is not allowing me to change the ID number. I have identified some ID numbers that are wrong and then tried to change but no success. It says that other tables are related. tried to change on the other tables first, still would not allow me. I need to change the wrong records. Any clues??
Cheer
 
Crabello,

I am not sure if this is applicable to your question about SetWarnings,
but if this facility has been "switched off" globally, you will find it
via Tools|Options menu, the Edit/Find tab, Confirm panel.

Assuming your ID numbers are not Autonumber data type, you will be able
to change them (being *very* careful to make sure all related tables get
changed consistently), but you will have to go to the Relationships
window, and do one of these with the relationships of the tables you are
trying to change...
- temporarily disable Referential Integrity
- temporarily enable Cascade Updates
 
Crabello,

I should have also stressed that you should make sure you have a backup
copy of your database! :-)
 
Hi Steve.... Grea
Tools/Options, confirm panel.... It was already all ticked, so I didn't need to do anything

Tried your second suggestion...disable Referential Integrity, enable cascade updates...
If I disable Ref Integrity would not allow me to enable cascade updates.. Option was to leave Referential Integrity enabled and also enable cascade updates....... Well, it is working now and I was able to change my wrong records, saved my life. Cheerio. Easy when you know how!!!!!!!! Thanks
 
H
As I said I can now change ID number and all related tables will change consistently, however if I add a duplicated record, once I close the form, it seems that the entry was saved but because it was duplicated it wasn't. The thing now is, I will never know if that record was saved or not because there is no warning to say that is a duplicated record. Any clue? In theory the system is doing the right thing because it's ignoring the duplictaed record but if I don't have a warning, I will think that entry was saved, when it wasn't, Got me? Or too confused
Help
 
Crabello,

A couple of key words in my earlier post were:
"temporarily"
"one of these"

Pleased to know your life has been spared!
 
Crabello,

If I understand the situation correctly, this problem occurs when you
use your own 'Close' button on the form. I would expect that if the
default top-right [X] close button is used to close the form, an error
message would be shown in this situation. But the use of DoCmd.Close
code on your own button will cause the problem you indicate. If I have
got this wrong, please let me know. Otherwise, the way around it is to
explicitly save the record before close, i.e. include code like this on
your close button...
If Me.Dirty Then
Me.Dirty = False
End If
DoCmd.Close acForm, Me.Name
This will throw an error message if you try to save a duplicate value.
 
Back
Top