Dr_Worm
Board Regular
- Joined
- Jul 28, 2003
- Messages
- 103
Need help with the following formula
What it's meant to do is if there is nothing in [Quote Number] on the main form and someone clicks on the additional information button a message box opens and the "Additional_Tender_Information" Form doesn't open
What it's meant to do is if there is nothing in [Quote Number] on the main form and someone clicks on the additional information button a message box opens and the "Additional_Tender_Information" Form doesn't open
Code:
Private Sub Additional_Tender_Information_Click()
On Error GoTo Err_Additional_Tender_Information_Click
Dim stDocName As String
Dim stLinkCriteria As String
If [Quote Number] = IsNull Then
DoCmd.Beep
Report_NoData
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
stDocName = "Tender Information"
stLinkCriteria = "[Quote Number]=" & "'" & Me![Quote Number] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Exit_Additional_Tender_Information_Click:
Exit Sub
Err_Additional_Tender_Information_Click:
MsgBox Err.Description
Resume Exit_Additional_Tender_Information_Click
End Sub
Private Sub Report_NoData()
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
strMsg = "Status needs to be on 'Requires Approval' to Print this Report."
intStyle = vbOKOnly
strTitle = "Print Error"
MsgBox strMsg, intStyle, strTitle
End Sub