[FONT="]I’m trying to automate a task that I perform daily at work using VBA. I’ve used very basic VBA code to manipulate data in excel before, but never anything involving access. [/FONT]
[FONT="] [/FONT]
[FONT="]Below, are the instructions that I’m hoping to convert to VBA code.[/FONT]
[FONT="] [/FONT]
[FONT="]I would be more than grateful for any kind of help, with ANY of the steps that I’m trying to automate. And I do apologize in advance for the lengthy instructions below; I was trying to be descriptive as possible, in order to show all the steps/variables that I’m trying to incorporate into the VBA code.
[/FONT]
[FONT="]
[/FONT]
[FONT="]Basic steps: Import files, Run Queries, and Export Queries.
[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Directions to import Primary File[/FONT]
[FONT="]>>Import the (mmddyy)_Primary_A_patinfo.txt file into the patinfo table, fixed width, select advanced, select specs, select Patinfo import spec, select Open, No Primary Key, Import To Table: patinfo, Yes to Overwrite existing table & it’s data.[/FONT]
[FONT="] [/FONT]
[FONT="]>>Import the (mmddyy)_Primary_C_patinfo.txt file (Appending a copy of the records to the table patinfo) into the patinfo table, fixed width, select advanced, select specs, select Patinfo import spec, select Open, No Primary Key, Import To Table: patinfo, Yes to Overwrite existing table & it’s data.[/FONT]
[FONT="] [/FONT]
[FONT="]>>Import the (mmddyy)_Primary_D_patinfo.txt file (Appending a copy of the records to the table patinfo) into the patinfo table, fixed width, select advanced, select specs, select Patinfo import spec, select Open, No Primary Key, Import To Table: patinfo, Yes to Overwrite existing table & it’s data.[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Directions to import Update File[/FONT]
[FONT="]>>Import the (mmddyy)_Update_A_patinfo.txt file into the patinfo-update table, fixed width, select advanced, select specs, select Patinfo import spec, select Open, No Primary Key, Import To Table: patinfo-update, Yes to Overwrite existing table & it’s data. [/FONT]
[FONT="] [/FONT]
[FONT="]>>Import the (mmddyy)_Update_C_patinfo.txt file (Appending a copy of the records to the table patinfo-update) into the patinfo table, fixed width, select advanced, select specs, select Patinfo import spec, select Open, No Primary Key, Import To Table: patinfo-update, Yes to Overwrite existing table & it’s data.[/FONT]
[FONT="] [/FONT]
[FONT="]>>Import the (mmddyy)_Update_D_patinfo.txt file (Appending a copy of the records to the table patinfo-update) into the patinfo table, fixed width, select advanced, select specs, select Patinfo import spec, select Open, No Primary Key, Import To Table: patinfo-update, Yes to Overwrite existing table & it’s data.[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Directions to import New business File[/FONT]
[FONT="]>>Import the newbusiness(mmddyy).txt file into the newbusiness table, fixed width, select advanced, select specs, newbusiness import spec, select Open, No Primary Key, Import To Table: newbusiness, Yes to Overwrite existing table & it’s data, Close.[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Directions to run Queries[/FONT]
[FONT="]>>Run the Query update: patinfo-update accounts with matching patinfo, say Yes to the warning that the action query is going to modify data in a table, say Yes to the warning that you’re about to updated #### row(s) in the table.[/FONT]
[FONT="] [/FONT]
[FONT="]>>Run the Query append: patinfo-update accounts without matching patinfo, say Yes to the warning that the action query is going to modify data in a table, say Yes to the warning that you’re about to updated #### row(s) in the table.[/FONT]
[FONT="] [/FONT]
[FONT="]
[/FONT]
[FONT="]Directions to Export Queries[/FONT]
[FONT="]>>Export Query newbusiness with Matching patinfo, Export>Excel, Filename: "\\my name\ClientDataProcessingFiles\client\NewBusiness\newbusiness With Matching patinfo (mmddyy).xls, save as type Excel 97-2003 (*.xls), check Export data with formatting and layout.[/FONT]
[FONT="] [/FONT]
[FONT="]>> Export Query patinfo letters, Export>Excel, Filename: "\\myname\ClientDataProcessingFiles\Client\NewBusiness\patinfo letters (mmddyy).xls save as type Excel 97-2003 (*.xls), check Export data with formatting and layout, enter date into dialog box (make date as 2 days before current date) (format mm/dd/yy).[/FONT]
[FONT="] [/FONT]
[FONT="]>> Export Query Edata Found In newbusiness, Export>Excel, Filename: "\\myname\ClientDataProcessingFiles\client\NewBusiness\Edata Found In newbusiness save as type Excel 97-2003 (*.xls), check Export data with formatting and layout.[/FONT]
[FONT="] [/FONT]
[FONT="]Below, are the instructions that I’m hoping to convert to VBA code.[/FONT]
[FONT="] [/FONT]
[FONT="]I would be more than grateful for any kind of help, with ANY of the steps that I’m trying to automate. And I do apologize in advance for the lengthy instructions below; I was trying to be descriptive as possible, in order to show all the steps/variables that I’m trying to incorporate into the VBA code.
[/FONT]
[FONT="]
[/FONT]
[FONT="]Basic steps: Import files, Run Queries, and Export Queries.
[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Directions to import Primary File[/FONT]
[FONT="]>>Import the (mmddyy)_Primary_A_patinfo.txt file into the patinfo table, fixed width, select advanced, select specs, select Patinfo import spec, select Open, No Primary Key, Import To Table: patinfo, Yes to Overwrite existing table & it’s data.[/FONT]
[FONT="] [/FONT]
[FONT="]>>Import the (mmddyy)_Primary_C_patinfo.txt file (Appending a copy of the records to the table patinfo) into the patinfo table, fixed width, select advanced, select specs, select Patinfo import spec, select Open, No Primary Key, Import To Table: patinfo, Yes to Overwrite existing table & it’s data.[/FONT]
[FONT="] [/FONT]
[FONT="]>>Import the (mmddyy)_Primary_D_patinfo.txt file (Appending a copy of the records to the table patinfo) into the patinfo table, fixed width, select advanced, select specs, select Patinfo import spec, select Open, No Primary Key, Import To Table: patinfo, Yes to Overwrite existing table & it’s data.[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Directions to import Update File[/FONT]
[FONT="]>>Import the (mmddyy)_Update_A_patinfo.txt file into the patinfo-update table, fixed width, select advanced, select specs, select Patinfo import spec, select Open, No Primary Key, Import To Table: patinfo-update, Yes to Overwrite existing table & it’s data. [/FONT]
[FONT="] [/FONT]
[FONT="]>>Import the (mmddyy)_Update_C_patinfo.txt file (Appending a copy of the records to the table patinfo-update) into the patinfo table, fixed width, select advanced, select specs, select Patinfo import spec, select Open, No Primary Key, Import To Table: patinfo-update, Yes to Overwrite existing table & it’s data.[/FONT]
[FONT="] [/FONT]
[FONT="]>>Import the (mmddyy)_Update_D_patinfo.txt file (Appending a copy of the records to the table patinfo-update) into the patinfo table, fixed width, select advanced, select specs, select Patinfo import spec, select Open, No Primary Key, Import To Table: patinfo-update, Yes to Overwrite existing table & it’s data.[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Directions to import New business File[/FONT]
[FONT="]>>Import the newbusiness(mmddyy).txt file into the newbusiness table, fixed width, select advanced, select specs, newbusiness import spec, select Open, No Primary Key, Import To Table: newbusiness, Yes to Overwrite existing table & it’s data, Close.[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Directions to run Queries[/FONT]
[FONT="]>>Run the Query update: patinfo-update accounts with matching patinfo, say Yes to the warning that the action query is going to modify data in a table, say Yes to the warning that you’re about to updated #### row(s) in the table.[/FONT]
[FONT="] [/FONT]
[FONT="]>>Run the Query append: patinfo-update accounts without matching patinfo, say Yes to the warning that the action query is going to modify data in a table, say Yes to the warning that you’re about to updated #### row(s) in the table.[/FONT]
[FONT="] [/FONT]
[FONT="]
[/FONT]
[FONT="]Directions to Export Queries[/FONT]
[FONT="]>>Export Query newbusiness with Matching patinfo, Export>Excel, Filename: "\\my name\ClientDataProcessingFiles\client\NewBusiness\newbusiness With Matching patinfo (mmddyy).xls, save as type Excel 97-2003 (*.xls), check Export data with formatting and layout.[/FONT]
[FONT="] [/FONT]
[FONT="]>> Export Query patinfo letters, Export>Excel, Filename: "\\myname\ClientDataProcessingFiles\Client\NewBusiness\patinfo letters (mmddyy).xls save as type Excel 97-2003 (*.xls), check Export data with formatting and layout, enter date into dialog box (make date as 2 days before current date) (format mm/dd/yy).[/FONT]
[FONT="] [/FONT]
[FONT="]>> Export Query Edata Found In newbusiness, Export>Excel, Filename: "\\myname\ClientDataProcessingFiles\client\NewBusiness\Edata Found In newbusiness save as type Excel 97-2003 (*.xls), check Export data with formatting and layout.[/FONT]