M
magmike
On a form, I have a button that opens another form only showing records
relating to the record on the previous form. The sub is as follows:
Private Sub ScheduleCB_Click()
On Error GoTo Err_ScheduleCB_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "CB - F6 (New)"
stLinkCriteria = "[RawLeads.CompanyID]=" & Me![RawLeads.CompanyID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ScheduleCB_Click:
Exit Sub
Err_ScheduleCB_Click:
MsgBox Err.Description
Resume Exit_ScheduleCB_Click
End Sub
However, if a user does not have a record open on the first form, they of
course get errors which confuses them and requires a visit from me to click
the buttons for them and tell them they can only click that button when they
have a record pulled up. Is there an easier way to address this in the code
so that the users understands without having to call me?
Thanks!
relating to the record on the previous form. The sub is as follows:
Private Sub ScheduleCB_Click()
On Error GoTo Err_ScheduleCB_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "CB - F6 (New)"
stLinkCriteria = "[RawLeads.CompanyID]=" & Me![RawLeads.CompanyID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ScheduleCB_Click:
Exit Sub
Err_ScheduleCB_Click:
MsgBox Err.Description
Resume Exit_ScheduleCB_Click
End Sub
However, if a user does not have a record open on the first form, they of
course get errors which confuses them and requires a visit from me to click
the buttons for them and tell them they can only click that button when they
have a record pulled up. Is there an easier way to address this in the code
so that the users understands without having to call me?
Thanks!