Not sure if this is exactly a programming question but here's my issue. I have a database that prompts the user to import a customer list from excel and after import, a bunch of pre-set queries analyze the data against some tables that are already in the database. It works great, except the customer list is pulled from our CRM and our CRM by default puts salutations in the 'first name field' on export. So "John, Mr" or "Nancy, Mrs". This screws up the queries that are meant to match first names.
Now I could easily deal with this in excel prior to import if I was the only one using the database, but the plan is for almost a dozen people using it and I want to design it with ease of use in mind. Any idea on how to get Access to remove those salutations on import or in a query after import? Below is my import code if it helps. Thanks
Code:
Public Sub bttnProcessIt_Click()
Dim wdShell As Object
' On Error GoTo ImportIt_Err
MsgBox "Remember to export the report in CRM as a a .XLS file", vbOKOnly
' Prompt user for file path for the Raw CRM spreadsheet
Application.FileDialog(msoFileDialogOpen).Title = "Please select the CRM file for processing"
Application.FileDialog(msoFileDialogOpen).InitialFileName = "F:\CRM"
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-CRM"
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"
DoCmd.RunSavedImportExport "Export-No Action Views Report"
DoCmd.RunSavedImportExport "Export-Summary Report"
DoCmd.Close acForm, Me.Name
StrResponse = MsgBox("The CRM review has been successfully imported and the exported files are located in the CRM folder!")
ImportIt_Exit:
Exit Sub
ImportIt_Err:
MsgBox Error$
Resume ImportIt_Exit
End Sub