gojets1721
Registered User.
- Local time
- Yesterday, 16:24
- Joined
- Jun 11, 2019
- Messages
- 430
Hi I've got the below code which is a form that imports in an excel file and then exports some files to excel based on that import. It also feeds into a report in access. I want to add in code that basically says "Import Complete! Would you like to open up the summary report? Yes/No" and then if no is selected, it closes the form. And if yes is selected, it opens the report within Access.
I have next to no idea how to write that. I inherited this database and while I understand all it's current workings, I don't know how to write new code. I was hoping someone might have a suggestion. Cheers
I have next to no idea how to write that. I inherited this database and while I understand all it's current workings, I don't know how to write new code. I was hoping someone might have a suggestion. Cheers
Code:
Public Sub bttnProcessIt_Click()
Dim wdShell As Object
' On Error GoTo ImportIt_Err
MsgBox "Remember to export the report as a .CSV file and then convert to a .XLS file in Excel", vbOKOnly
' Prompt user for file path for the Raw Data spreadsheet
Application.FileDialog(msoFileDialogOpen).Title = "Please select the PHI file for processing"
Application.FileDialog(msoFileDialogOpen).InitialFileName = "F:\Complaints"
Application.FileDialog(msoFileDialogOpen).Filters.Add "Excel Spreadsheets", "*.xlsx", 1
Application.FileDialog(msoFileDialogOpen).FilterIndex = 1
Application.FileDialog(msoFileDialogOpen).Show
strFile_Path = Application.FileDialog(msoFileDialogOpen).SelectedItems.Item(1)
DoCmd.SetWarnings (WarningsOff)
DoCmd.OpenQuery "qryClear_RawAudit"
DoCmd.RunSavedImportExport "Import-Data"
DoCmd.RunSavedImportExport "Export-Last Name Match Report"
DoCmd.RunSavedImportExport "Export-First and Last Name Match Report"
DoCmd.RunSavedImportExport "Export-Address Match Report"
DoCmd.RunSavedImportExport "Export-Phone Number Match Report"
DoCmd.RunSavedImportExport "Export-High Profile Staff Match Report"
StrResponse = MsgBox("Process Complete!")
ImportIt_Exit:
Exit Sub
ImportIt_Err:
MsgBox Error$
Resume ImportIt_Exit
End Sub