Originally Posted by
lenius
[FONT='Verdana','sans-serif']I would break down the if blocks into sections. This way you can customize what the msgbox displays. For example the first if block you can change the message to "Please check your input at the PBA Facility on the Facility tab." You can also set the focus to the exact area that met the conditions. I hope that helps. [/font]
[FONT='Verdana','sans-serif'][/font]
[FONT='Verdana','sans-serif']Private Sub cmd_LO_PBA_Facility_Click()
On Error GoTo Err_Cmd_LO_PBA_Facility_Click
Me.Refresh
Dim stDocName As String
If cmb_Product_Type = "PBA Facility" Then[/font]
[FONT='Verdana','sans-serif']MsgBox "Please check your input at Revolving Credit Facility tab"
Me!RCF_Limit.SetFocus[/font]
[FONT='Verdana','sans-serif']Exit sub[/font]
[FONT='Verdana','sans-serif']End IF[/font]
[FONT='Verdana','sans-serif']If Not IsNull(RCF_Limit) Then
MsgBox "Please check your input at Revolving Credit Facility tab"[/font]
[FONT='Verdana','sans-serif']Me!RCF_Limit.SetFocus[/font]
[FONT='Verdana','sans-serif']Exit sub[/font]
[FONT='Verdana','sans-serif']End IF[/font]
[FONT='Verdana','sans-serif']If Not IsNull(FX_Option_Limit) Then[/font]
[FONT='Verdana','sans-serif']MsgBox "Please check your input at Revolving Credit Facility tab"
Me!RCF_Limit.SetFocus[/font]
[FONT='Verdana','sans-serif']Exit sub[/font]
[FONT='Verdana','sans-serif']End IF
If Not IsNull(Security_Option_Limit) Then[/font]
[FONT='Verdana','sans-serif']MsgBox "Please check your input at Revolving Credit Facility tab"
Me!RCF_Limit.SetFocus[/font]
[FONT='Verdana','sans-serif']Exit sub[/font]
[FONT='Verdana','sans-serif']End IF[/font]
[FONT='Verdana','sans-serif']
If Not IsNull(PBA_Account_No) Then
MsgBox "Please check your input at Revolving Credit Facility tab"[/font]
[FONT='Verdana','sans-serif']Me!RCF_Limit.SetFocus[/font]
[FONT='Verdana','sans-serif']Exit sub[/font]
[FONT='Verdana','sans-serif']End IF[/font]
[FONT='Verdana','sans-serif']If Not IsNull(Interest_Rate) Then[/font]
[FONT='Verdana','sans-serif']MsgBox "Please check your input at Revolving Credit Facility tab"
Me!RCF_Limit.SetFocus[/font]
[FONT='Verdana','sans-serif']Exit sub[/font]
[FONT='Verdana','sans-serif']End if
stDocName = "PBA_Facility_LO"
DoCmd.OpenReport stDocName, acPreview
Exit_Cmd_LO_PBA_Facility_Click:
Exit Sub
Err_Cmd_LO_PBA_Facility_Click:
MsgBox Err.Description
Resume Exit_Cmd_LO_PBA_Facility_Click
End Sub[/font]