setwarnings doesn't work

lala

Registered User.
Local time
Today, 14:08
Joined
Mar 20, 2002
Messages
741
i use setwarnings on opening of the database and never turn it back on. i want it to stay permanently off.

i don't know if it's a coincidence but since i moved the BE to SQL server - the warnings turn back on after using some forms. i'm getting the "are you sure you want to replace the table" when running a make-table query that replaces a local (not linked) table.

how can that happen? arent they supposed to stay off until they're turned back on? or am i missing something?
this worked for months with an access BE btw

thank you
 
Indiscriminately turning off warnings isn't such a good idea because you won't get warnings about things that do matter. Most developers use code that avoids warnings or turns them off before a procedure and then back on after.

BTW I also recommend not writing temporary tables to the front end but to another separate local database. This avoids bloating the front end.
 
Indiscriminately turning off warnings isn't such a good idea because you won't get warnings about things that do matter. Most developers use code that avoids warnings or turns them off before a procedure and then back on after.

BTW I also recommend not writing temporary tables to the front end but to another separate local database. This avoids bloating the front end.

i know that it bloats it but i don't like having another database. i compact on close so i should be ok. these are small anyway.

as far as turning off warnings - i don't want users to see any messages at all. i think i wrote code that stops them all but in case i didn't - i don't want them to show up.


so do you know why they turn bak on their own? i'm already rewriting all make table queries to use db.execute instead of docmd.runsql but i have A LOT of them and i'm hoping to launch this in the morning
 
I have not come across Warnings turning on by themselves but then I rarely use processes that affect warnings.
 
I doubt very much that warnings turn themselves on. Have you checked that after your "move to SQL backend" you don't have set warnings buried somewhere in new/modified code or macro? I concur with Galaxiom that turning warnings off globally is not usual practice.

Changing to db.execute deprives you of using expression service in the sql statements - the thing no longer knows about forms and form controls.
 
perhaps that isn't so much a normal warning - but a distinct confirmation.

an easy way round it, would be to delete the table first - then create it. just error trap the delete in case you get a "doesn't exist" error.
 
I doubt very much that warnings turn themselves on. Have you checked that after your "move to SQL backend" you don't have set warnings buried somewhere in new/modified code or macro? I concur with Galaxiom that turning warnings off globally is not usual practice.

Changing to db.execute deprives you of using expression service in the sql statements - the thing no longer knows about forms and form controls.

i figured it out. they turn themselves back on when i go into design of forms and make changes in the vba behind it.

and i ended up not using db.execute because it didn't work anyway.
 
perhaps that isn't so much a normal warning - but a distinct confirmation.

an easy way round it, would be to delete the table first - then create it. just error trap the delete in case you get a "doesn't exist" error.

Gemma, i really needed you over the weekend: i had 1001 questions)))))))))) but that's ok, i got more lined up))))))))))

as far as the warnings - i just posted what i think is happening: they turn themselves on once i make some kind of changes to the forms and/or vba. i haven't figured exactlt what it is that turns them on: just modifying the form design, modifying vba or does there have to be the End-Debug error message and just modifying things won't turn them off.

i just turn them on on load of every form. i want to make sure users don't get any messages at all except the ones that i wanted them to get.



ok, on to more important stuff)))))))))

how do i save a record on another form? i googled, i swear but there's not a clear cut answer. i saw a very ugly workaround: to create a record and then delete it (because once u leave the record it saves it).

thank you
 

Users who are viewing this thread

Back
Top Bottom