when opening a form and no data is present runtime error 2757. Would like message box instead of error.
Posted on 2005-04-20
Hi - I have a form that lists TMX_MgrTarget, which are employee numbers. There is a summary button that can be selected which opens another form (Frm_EmployeeSummary) and shows detail for this manager. if someone clicks on the open form where no manager exists (TMX_MgrTarget is null) , logically, I get a run-time error '2757' asking the user to end or debug. I would like a message box instead that states that no manager has been selected. I am just not sure how to go about this.
Here is the code that opens the Frm_EmployeeSummary:
Private Sub opensum_Click()
On Error GoTo Err_opensum_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Frm_EmployeeSummary"
stLinkCriteria = "[TMXID]=" & Me![TMX_MgrTarget]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Any help would be greatly appreaciated.