Re: Suppress warnings with code
- From: Niniel <Niniel@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 12 Oct 2006 13:31:01 -0700
Ok, I see what you mean.
I stumbled upon this solution to my question, and there are no messages
whatsoever.
Private Sub LocationID_NotInList(NewData As String, Response As Integer)
' Opens form to enter new location
Dim stDocName As String
stDocName = "frmNewLocation"
DoCmd.OpenForm stDocName, acNormal, , , acFormAdd, acDialog
Response = acDataErrAdded
End Sub
"Niniel" wrote:
Ok, maybe "error message" wasn't the right word... I mean the message that.
the new value is not in the list.
Is there a way to suppress that?
Looks like docmd.setwarnings doesn't do that; or maybe I just need to put it
somewhere else?
___
Private Sub LocationID_NotInList(NewData As String, Response As Integer)
' Opens form to enter new location
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmNewLocation"
DoCmd.SetWarnings False
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
DoCmd.SetWarnings True
End Sub
"John Vinson" wrote:
On Thu, 12 Oct 2006 11:21:02 -0700, Niniel
<Niniel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hello,
I want to use the Not In List event to launch a form to enter new
information, but I don't want the user to see the error message. I could use
a macro to disable the warnings, but I'd like to know how that can be done in
code.
Any assistance would be appreciated.
Thank you.
DoCmd.SetWarnings False
before the event which triggers the error.
Actually if you write the NotInList code correctly as described in its
VBA Help, you shouldn't get any error messages in the first place!
John W. Vinson[MVP]
- References:
- Re: Suppress warnings with code
- From: John Vinson
- Re: Suppress warnings with code
- Prev by Date: When Opening Form
- Next by Date: Re: Tabbed Form / Number of Tabs per row
- Previous by thread: Re: Suppress warnings with code
- Next by thread: Re: The wizard for the subform/reports will not show a list of tab
- Index(es):
Relevant Pages
|