Hi,
The code below is working well, it opens an Excel spreadsheet version of the query I want to run and it saves fine. However, if I click "cancel" instead of choosing to save the spreadsheet, Access crashes out. Any ideas what I need to change please? Thank, Jim (p.s., not sure if you need the command button VBA, or the VBA from the form it opens once clicked?)
Private Sub Command6_Click()
On Error GoTo Err_Command6_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "RegionCode Dialog Box"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acEdit
ReportName = "53_5 Group Wide Training Carer Report Excel"
Exit_Command6_Click:
Exit Sub
Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click
End Sub
The code below is working well, it opens an Excel spreadsheet version of the query I want to run and it saves fine. However, if I click "cancel" instead of choosing to save the spreadsheet, Access crashes out. Any ideas what I need to change please? Thank, Jim (p.s., not sure if you need the command button VBA, or the VBA from the form it opens once clicked?)
Private Sub Command6_Click()
On Error GoTo Err_Command6_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "RegionCode Dialog Box"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acEdit
ReportName = "53_5 Group Wide Training Carer Report Excel"
Exit_Command6_Click:
Exit Sub
Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click
End Sub