M
Max
Why does this work when placed directly behind the form as an "Expression",
but fails as a "Function"???? The point of failure is the response =
acDataErrContinue, which turns of access system messages.
I currently use this same piece of code several times in the DB, but thought
it would be better calling it as a function from within a module?????
Does it need to be specified as a public function or something, basicly
trying to reference same message several times?? Have search Microsoft and
other sites on the net but no help or luck so far.
----------------------------------------------------------------------------
----
Function getNotInList()
Dim strMsg As String
Dim strTitle As String
Dim intStyle As Integer
strMsg = "You Must Select an Option from the List Available!" &
vbCrLf & "Please See Admin Department for Additions to This Listing."
intStyle = vbOKOnly + vbExclamation
strTitle = "WinZues - Invalid Data Input"
MsgBox strMsg, intStyle, strTitle
response = acDataErrContinue 'Disables system default error
messages
' Response = acDataErrDisplay 'Enables system default error
messages
End Function
----------------------------------------------------------------------------
----
this is same code that sit on the "OnNotInList" property of form control -
this works but used too often
----------------------------------------------------------------------------
----
Private Sub StaffStatus_NotInList(newdata As String, response As Integer)
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
strMsg = "You Must Select a Status from the List Available!" &
vbCrLf & "Please See Admin Department for Additions to This Listing."
intStyle = vbOKOnly + vbExclamation
strTitle = "WinZeus - Invalid Data Input"
MsgBox strMsg, intStyle, strTitle
response = acDataErrContinue 'Disables system default error
messages
' Response = acDataErrDisplay 'Enables system default error
messages
End Sub
but fails as a "Function"???? The point of failure is the response =
acDataErrContinue, which turns of access system messages.
I currently use this same piece of code several times in the DB, but thought
it would be better calling it as a function from within a module?????
Does it need to be specified as a public function or something, basicly
trying to reference same message several times?? Have search Microsoft and
other sites on the net but no help or luck so far.
----------------------------------------------------------------------------
----
Function getNotInList()
Dim strMsg As String
Dim strTitle As String
Dim intStyle As Integer
strMsg = "You Must Select an Option from the List Available!" &
vbCrLf & "Please See Admin Department for Additions to This Listing."
intStyle = vbOKOnly + vbExclamation
strTitle = "WinZues - Invalid Data Input"
MsgBox strMsg, intStyle, strTitle
response = acDataErrContinue 'Disables system default error
messages
' Response = acDataErrDisplay 'Enables system default error
messages
End Function
----------------------------------------------------------------------------
----
this is same code that sit on the "OnNotInList" property of form control -
this works but used too often
----------------------------------------------------------------------------
----
Private Sub StaffStatus_NotInList(newdata As String, response As Integer)
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
strMsg = "You Must Select a Status from the List Available!" &
vbCrLf & "Please See Admin Department for Additions to This Listing."
intStyle = vbOKOnly + vbExclamation
strTitle = "WinZeus - Invalid Data Input"
MsgBox strMsg, intStyle, strTitle
response = acDataErrContinue 'Disables system default error
messages
' Response = acDataErrDisplay 'Enables system default error
messages
End Sub