GarageFlower
Registered User.
- Local time
- Today, 17:03
- Joined
- May 20, 2004
- Messages
- 108
I have a form with the text box "Project Name"
I have used a command button placed next to the project name box which if clicked opens up a finance details form for the project name box.
Problem is if that project does not have any finance details it still opens up the form but just comes up as totally blank.
Is there anyway i can get an error message to come up and say
"No matching data found for this project" when they click the command button to open up the finance form, but there is no finance data?
I have tried but unsuccessfully.
I entered this code
Private Sub Label75_Click()
On Error GoTo Err_Label75_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Contract Filtered"
If Combo22 = "" Then
MsgBox "No Matching Data Found", vbExclamation
End If
stLinkCriteria = "[Project Number]=" & Me![ProjectName]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Label75_Click:
Exit Sub
Err_Label75_Click:
MsgBox Err.Description
Resume Exit_Label75_Click
End Sub
But instead of not opening the blank form, it comes up with the error message and then opens the blank form.
Or if there is finance data for that project it comes up with the error box still and opens the form
Any ideas people?
Thank you please
I have used a command button placed next to the project name box which if clicked opens up a finance details form for the project name box.
Problem is if that project does not have any finance details it still opens up the form but just comes up as totally blank.
Is there anyway i can get an error message to come up and say
"No matching data found for this project" when they click the command button to open up the finance form, but there is no finance data?
I have tried but unsuccessfully.
I entered this code
Private Sub Label75_Click()
On Error GoTo Err_Label75_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Contract Filtered"
If Combo22 = "" Then
MsgBox "No Matching Data Found", vbExclamation
End If
stLinkCriteria = "[Project Number]=" & Me![ProjectName]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Label75_Click:
Exit Sub
Err_Label75_Click:
MsgBox Err.Description
Resume Exit_Label75_Click
End Sub
But instead of not opening the blank form, it comes up with the error message and then opens the blank form.
Or if there is finance data for that project it comes up with the error box still and opens the form
Any ideas people?
Thank you please