I OFTEN use a msgbox as a way of flagging 'something' to the user
within a module, file, ... I 'might' use one several times, occasionally within a single method;
I set them up like this:
Code:
Public Sub ControlMismatchFlag(frm As Access.Form)
Dim strTitle As String
Dim strText As String
Dim Response as Variant
$P[METHOD_BODY]
If <something> Then
strTitle = "CONTRARY SOURCE / CONTROL PROTOCOL"
strText = "You have a SOURCE and CONTROL PROTOCOL combination that is not possible; " _
& vbCrLf _
& "you'll need to change one or the other"
Response = MsgBox(strText, vbInformation + vbOKOnly, strTitle)
End If
$P[METHOD_BODY]
End Sub
and find myself adding :
Code:
Dim strTitle As String
Dim strText As String
Dim Response as Variant
at the beginning of EACH method... (again, and again, and again)
?
-> would it make more sense to DIM the variables just once (as public, at the beginning of each module) ?
-> and if so, then would once (is a general purpose module) for the ENTIRE PROJECT ?
with much thnx in advance,
m.