PC Review


Reply
Thread Tools Rate Thread

docmd.SetWarnings ac 97 status

 
 
egerds
Guest
Posts: n/a
 
      28th Jan 2010
How does on return what the true/false 0 or -1 of current status
docmd.SetWarnings in access 97?

like a
dim byt_X as byte
byt_X = SetWarnings(?).?
without the docmd
 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      28th Jan 2010
egerds wrote:

>How does on return what the true/false 0 or -1 of current status
>docmd.SetWarnings in access 97?
>
>like a
>dim byt_X as byte
>byt_X = SetWarnings(?).?
>without the docmd



Dumb, but there's no way to get that status.

I suppose you could create a function or two to keep track
of it, but I wouldn't bother.

OTOH, you should stay away from methods that generate those
warning messages. Instead, use other methods that allow you
to use error trapping (OnError GoTo ,,,)

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      29th Jan 2010
As Marshall says, Access doesn't provide the status of SetWarnings to you.

What are you doing that requires you to set/know this?
There may be a better way, e.g.:
Action queries: suppressing dialogs, while knowing result
at:
http://allenbrowne.com/ser-60.html

In the end, you could create a public variable in a standard module (not
that of a form or report), and set/read it as required. This kind of thing:
Public bWarningsOff As Boolean
Function SetTheWarnings(bWarning as Boolean) As Boolean
bWarningsOff = bWarning
DoCmd.SetWarnings bWarning
SetTheWarnings = bWarning
End Sub
Function GetTheWarnings() As Boolean
GetTheWarnings = bWarningsOff
End Function

Then you use SetTheWarnings instead of DoCmd.SetWarnings. In your app's
initializations, include:
Call SetThwWarnings(False)
so that the variable and actual state match when the database opens.

The main trouble with this is that the public variable is reset to False
when you reset your code, as you frequently do during development.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"egerds" <(E-Mail Removed)> wrote in message
news:fce3ecf7-4ff0-452d-97d8-(E-Mail Removed)...
> How does on return what the true/false 0 or -1 of current status
> docmd.SetWarnings in access 97?
>
> like a
> dim byt_X as byte
> byt_X = SetWarnings(?).?
> without the docmd
>

 
Reply With Quote
 
egerds
Guest
Posts: n/a
 
      3rd Feb 2010
Nothing personally, it was asked by a coworker of mine. I prefer not
to use docmd myself but db.execute.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
docmd.setwarnings best use Mark Andrews Microsoft Access 1 4th Nov 2008 04:53 PM
DoCmd.SetWarnings B F Cole Microsoft Access Form Coding 0 12th Sep 2006 02:12 AM
DoCmd.SetWarnings Frank Dulk Microsoft Access Forms 1 6th Mar 2005 08:00 PM
DoCmd.SetWarnings not working Tony_VBACoder Microsoft Access Form Coding 0 24th Aug 2004 03:25 PM
DoCmd.SetWarnings False Jenny Microsoft Access 3 15th Sep 2003 03:04 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:53 PM.