Hi,
I have customer form and a Review Rate button to open RateDisplay form so when they are looking at a company they can review the rate for this company by clicking the Review Rate button.
This is the code:
how can i add to this code another line of code to display a message there's not rate for this company and don't open the RateDisplay form, when this company doesn't have rate yet?
thank you
I have customer form and a Review Rate button to open RateDisplay form so when they are looking at a company they can review the rate for this company by clicking the Review Rate button.
This is the code:
Code:
Private Sub ReviewRate_Click()
' This code created in part by Command Button Wizard.
On Error GoTo Err_ReviewRate_Click
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
Dim strDocName As String, strLinkCriteria As String
' If CompanyName control is blank, display a message.
If IsNull(Me![Combo54]) Then
strMsg = "Select the Company/company record whose rates you want to see, then press the Review Rate button again."
intStyle = vbOKOnly
strTitle = "Select a Company"
MsgBox strMsg, intStyle, strTitle
Me![Combo54].SetFocus
Else
' Otherwise, open Rate Display form, showing products for current supplier.
strDocName = "RateDisplay"
strLinkCriteria = "[CompanyID] = Forms![CUSTOMERS]![COMPANYID]"
DoCmd.OpenForm strDocName, , , strLinkCriteria
DoCmd.MoveSize (1440 * 0.78), (1440 * 1.8)
End If
Exit_ReviewProducts_Click:
Exit Sub
Err_ReviewProducts_Click:
MsgBox Err.Description
Resume Exit_ReviewRate_Click
End Sub
thank you