X
Xyon
Hello EveryOne,
I have a custom message box form which it does what it
says, it substitutes the already built-in MsgBox. At the
moment the form is call from any given form through a
standard module function.
------------------------------
''' begin Function basCustomMsgBox Module
Option Compare Database
Option Explicit
Private Const stMsgBoxForm = "frmCustomMsgBox"
'opens the custom message box with it's appropriate
'message ID #
Public Sub srOpenCustomMsgBox(stCustomMsgID As String)
DoCmd.OpenForm stCustomMsgBoxName, acNormal, ,
stCustomMsgID
End Sub
'obtain response from custom message box and do
'events based on value.
'this is the part I can't seem to figure out. HELP!!!
'the code works I, just don't know how to pass the
'vaules to the calling form
Function fResponse(intResponse As Integer) As Integer
fResponse = intResponse
Select Case fResponse
Case 1
MsgBox "Yes" 'display what was choosen
DoCmd.Close acForm, stCustomMsgBoxName
Case 2
MsgBox "No" 'display what was choosen
DoCmd.Close acForm, stCustomMsgBoxName
Case 3
'keep on checking until answer is "Yes" or "No"
End Select
End Sub
'''end Function code
------------------------------
The custom message box has the following code:
------------------------------
'''begin frmCustomMsgBox code
Private Sub Form_Load()
'code to animate the form to open from bottom to top
'on the bottom-right corner of Acess, this works fine.
End Sub
'define variable for the fResponse Function
Private Sub optMsgBoxResponse_AfterUpdate()
mdCustomMsgBox.fResponse (Me.optMsgBoxResponse)
End Sub
'''end code
------------------------------
The custom message box has an acOptionGroup
control. Once the form is open the user can select the
appropriate action (eg. Yes(1), No(2)). All forms have a
way to call the custom message box. Depending on the
situation, the form calls the message box and displays the
appropriate message from "tblCustomMsgBox" and it's call
in the following way:
------------------------------
'''begin CallingForm code
Private cmdQuitApp_Click()
Me!Visible = False
Call srOpenCustomMsgBox("[sysMsgID] = 2")
'This is where I get stuck. I need to know what the
'user selects and based on that do the following
If 'user selects selects "Yes(1)" Then
DoCmd.Quit
ElseIf 'user selects "No(2)" then
Me.Visible = True
ElseIf 'user has not choosen then
'Continue checking until user selects an option
End If
End Sub
'''end code
------------------------------
Is there a better way to accomplish my task ? Am I
overlooking something ? If the above made sense, please
help. Thank you all in advance.
Xyon G. Kinkay
I have a custom message box form which it does what it
says, it substitutes the already built-in MsgBox. At the
moment the form is call from any given form through a
standard module function.
------------------------------
''' begin Function basCustomMsgBox Module
Option Compare Database
Option Explicit
Private Const stMsgBoxForm = "frmCustomMsgBox"
'opens the custom message box with it's appropriate
'message ID #
Public Sub srOpenCustomMsgBox(stCustomMsgID As String)
DoCmd.OpenForm stCustomMsgBoxName, acNormal, ,
stCustomMsgID
End Sub
'obtain response from custom message box and do
'events based on value.
'this is the part I can't seem to figure out. HELP!!!
'the code works I, just don't know how to pass the
'vaules to the calling form
Function fResponse(intResponse As Integer) As Integer
fResponse = intResponse
Select Case fResponse
Case 1
MsgBox "Yes" 'display what was choosen
DoCmd.Close acForm, stCustomMsgBoxName
Case 2
MsgBox "No" 'display what was choosen
DoCmd.Close acForm, stCustomMsgBoxName
Case 3
'keep on checking until answer is "Yes" or "No"
End Select
End Sub
'''end Function code
------------------------------
The custom message box has the following code:
------------------------------
'''begin frmCustomMsgBox code
Private Sub Form_Load()
'code to animate the form to open from bottom to top
'on the bottom-right corner of Acess, this works fine.
End Sub
'define variable for the fResponse Function
Private Sub optMsgBoxResponse_AfterUpdate()
mdCustomMsgBox.fResponse (Me.optMsgBoxResponse)
End Sub
'''end code
------------------------------
The custom message box has an acOptionGroup
control. Once the form is open the user can select the
appropriate action (eg. Yes(1), No(2)). All forms have a
way to call the custom message box. Depending on the
situation, the form calls the message box and displays the
appropriate message from "tblCustomMsgBox" and it's call
in the following way:
------------------------------
'''begin CallingForm code
Private cmdQuitApp_Click()
Me!Visible = False
Call srOpenCustomMsgBox("[sysMsgID] = 2")
'This is where I get stuck. I need to know what the
'user selects and based on that do the following
If 'user selects selects "Yes(1)" Then
DoCmd.Quit
ElseIf 'user selects "No(2)" then
Me.Visible = True
ElseIf 'user has not choosen then
'Continue checking until user selects an option
End If
End Sub
'''end code
------------------------------
Is there a better way to accomplish my task ? Am I
overlooking something ? If the above made sense, please
help. Thank you all in advance.
Xyon G. Kinkay