Hello
I'm a user not a programmer and I'm hoping for a bit more help following up on assistance from John Big Booty a few months back.
I used some code from John Big Booty to import a spreadsheet into a temp table and then run a series of queries to move the data to their final tables. Here it is:
Private Sub cmdImportOPR_Click()
DoCmd.SetWarnings False
'import the Operational Phase Report
DoCmd.TransferSpreadsheet acImport, , "tbl_opr_temp", Me!txtFilePath, False, "a1:z600"
'associate OPR with a discrete project
DoCmd.OpenQuery "q80_update_application_id_to_opr_temp"
DoCmd.OpenQuery "q80_update_tbl_opr_temp_f28"
'move the data from the temporary table to the appropriate tables
DoCmd.OpenQuery "q80_append_cdm/cp_6"
DoCmd.OpenQuery "q80_append_ohp/n_links_6"
DoCmd.OpenQuery "q80_append_opr_days_6"
DoCmd.OpenQuery "q80_append_practice_services_6"
DoCmd.OpenQuery "q80_append_tbl_opr_team_based_processes_6"
DoCmd.OpenQuery "q80_append_tbl_opr_training_programs_6"
DoCmd.OpenQuery "q80_append_tbl_opr_training_provided_6"
DoCmd.OpenQuery "q80_append_to_tbl_opr_workforce_professional"
DoCmd.OpenQuery "q80_update_barriers_to_accessibility"
DoCmd.OpenQuery "q80_update_clinical_training_reflect_project_plan_12"
DoCmd.OpenQuery "q80_update_clinical_training_reflect_project_plan_6"
DoCmd.OpenQuery "q80_update_clinical_training_story_12"
DoCmd.OpenQuery "q80_update_clinical_training_story_6"
DoCmd.OpenQuery "q80_update_community_benefits"
DoCmd.OpenQuery "q80_update_ed_relief"
DoCmd.OpenQuery "q80_update_extended_hours_reflect_project_plan_12"
DoCmd.OpenQuery "q80_update_extended_hours_reflect_project_plan_6"
DoCmd.OpenQuery "q80_update_extended_hours_story_12"
DoCmd.OpenQuery "q80_update_extended_hours_story_6"
DoCmd.OpenQuery "q80_update_focus_on_preventive_health"
DoCmd.OpenQuery "q80_update_focus_on_priority_areas"
DoCmd.OpenQuery "q80_update_future_planned_activities"
DoCmd.OpenQuery "q80_update_good_news_story"
DoCmd.OpenQuery "q80_update_ohp/n_12"
DoCmd.OpenQuery "q80_update_pa_story_12"
DoCmd.OpenQuery "q80_update_pa_story_6"
DoCmd.OpenQuery "q80_update_patient_waiting_times"
DoCmd.OpenQuery "q80_update_practice_benefits"
DoCmd.OpenQuery "q80_update_practice_services_12"
DoCmd.OpenQuery "q80_update_processes_to_share_patient_records_within_practice_12"
DoCmd.OpenQuery "q80_update_processes_to_share_patient_records_within_practice_6"
DoCmd.OpenQuery "q80_update_promotional_activities"
DoCmd.OpenQuery "q80_update_recruitment_story_12"
DoCmd.OpenQuery "q80_update_recruitment_story_6"
DoCmd.OpenQuery "q80_update_services_story_12"
DoCmd.OpenQuery "q80_update_services_story_6"
DoCmd.OpenQuery "q80_update_tbl_opr_cdm/cp_12"
DoCmd.OpenQuery "q80_update_tbl_opr_days_12"
DoCmd.OpenQuery "q80_update_tbl_opr_training_programs_12"
DoCmd.OpenQuery "q80_update_tbl_opr_training_provided_12"
DoCmd.OpenQuery "q80_update_tbl_opr_workforce_professional_12"
DoCmd.OpenQuery "q80_update_team_based_story_12"
DoCmd.OpenQuery "q80_update_team_based_story_6"
DoCmd.OpenQuery "q80_update_team_based_processes_12"
'Advise project officer that upload was successful
MsgBox "The Operational Phase Report upload was successful"
'erase the Operational Phase Report from the temp table ready for the next OPR to be loaded.
DoCmd.OpenQuery "q80_delete_tbl_opr_temp"
DoCmd.SetWarnings True
End Sub
But the table only contains the first part of the text in several cells in the source spreadsheet.
Can I alter this part DoCmd.TransferSpreadsheet acImport, , "tbl_opr_temp", Me!txtFilePath, False, "a1:z600" to make access capture the entire contents of each cell?
Looking forward to hearing from anyone with a suggestion.
I'm a user not a programmer and I'm hoping for a bit more help following up on assistance from John Big Booty a few months back.
I used some code from John Big Booty to import a spreadsheet into a temp table and then run a series of queries to move the data to their final tables. Here it is:
Private Sub cmdImportOPR_Click()
DoCmd.SetWarnings False
'import the Operational Phase Report
DoCmd.TransferSpreadsheet acImport, , "tbl_opr_temp", Me!txtFilePath, False, "a1:z600"
'associate OPR with a discrete project
DoCmd.OpenQuery "q80_update_application_id_to_opr_temp"
DoCmd.OpenQuery "q80_update_tbl_opr_temp_f28"
'move the data from the temporary table to the appropriate tables
DoCmd.OpenQuery "q80_append_cdm/cp_6"
DoCmd.OpenQuery "q80_append_ohp/n_links_6"
DoCmd.OpenQuery "q80_append_opr_days_6"
DoCmd.OpenQuery "q80_append_practice_services_6"
DoCmd.OpenQuery "q80_append_tbl_opr_team_based_processes_6"
DoCmd.OpenQuery "q80_append_tbl_opr_training_programs_6"
DoCmd.OpenQuery "q80_append_tbl_opr_training_provided_6"
DoCmd.OpenQuery "q80_append_to_tbl_opr_workforce_professional"
DoCmd.OpenQuery "q80_update_barriers_to_accessibility"
DoCmd.OpenQuery "q80_update_clinical_training_reflect_project_plan_12"
DoCmd.OpenQuery "q80_update_clinical_training_reflect_project_plan_6"
DoCmd.OpenQuery "q80_update_clinical_training_story_12"
DoCmd.OpenQuery "q80_update_clinical_training_story_6"
DoCmd.OpenQuery "q80_update_community_benefits"
DoCmd.OpenQuery "q80_update_ed_relief"
DoCmd.OpenQuery "q80_update_extended_hours_reflect_project_plan_12"
DoCmd.OpenQuery "q80_update_extended_hours_reflect_project_plan_6"
DoCmd.OpenQuery "q80_update_extended_hours_story_12"
DoCmd.OpenQuery "q80_update_extended_hours_story_6"
DoCmd.OpenQuery "q80_update_focus_on_preventive_health"
DoCmd.OpenQuery "q80_update_focus_on_priority_areas"
DoCmd.OpenQuery "q80_update_future_planned_activities"
DoCmd.OpenQuery "q80_update_good_news_story"
DoCmd.OpenQuery "q80_update_ohp/n_12"
DoCmd.OpenQuery "q80_update_pa_story_12"
DoCmd.OpenQuery "q80_update_pa_story_6"
DoCmd.OpenQuery "q80_update_patient_waiting_times"
DoCmd.OpenQuery "q80_update_practice_benefits"
DoCmd.OpenQuery "q80_update_practice_services_12"
DoCmd.OpenQuery "q80_update_processes_to_share_patient_records_within_practice_12"
DoCmd.OpenQuery "q80_update_processes_to_share_patient_records_within_practice_6"
DoCmd.OpenQuery "q80_update_promotional_activities"
DoCmd.OpenQuery "q80_update_recruitment_story_12"
DoCmd.OpenQuery "q80_update_recruitment_story_6"
DoCmd.OpenQuery "q80_update_services_story_12"
DoCmd.OpenQuery "q80_update_services_story_6"
DoCmd.OpenQuery "q80_update_tbl_opr_cdm/cp_12"
DoCmd.OpenQuery "q80_update_tbl_opr_days_12"
DoCmd.OpenQuery "q80_update_tbl_opr_training_programs_12"
DoCmd.OpenQuery "q80_update_tbl_opr_training_provided_12"
DoCmd.OpenQuery "q80_update_tbl_opr_workforce_professional_12"
DoCmd.OpenQuery "q80_update_team_based_story_12"
DoCmd.OpenQuery "q80_update_team_based_story_6"
DoCmd.OpenQuery "q80_update_team_based_processes_12"
'Advise project officer that upload was successful
MsgBox "The Operational Phase Report upload was successful"
'erase the Operational Phase Report from the temp table ready for the next OPR to be loaded.
DoCmd.OpenQuery "q80_delete_tbl_opr_temp"
DoCmd.SetWarnings True
End Sub
But the table only contains the first part of the text in several cells in the source spreadsheet.
Can I alter this part DoCmd.TransferSpreadsheet acImport, , "tbl_opr_temp", Me!txtFilePath, False, "a1:z600" to make access capture the entire contents of each cell?
Looking forward to hearing from anyone with a suggestion.