Uploading Excel file to specific fields in Access

%3CLINGO-SUB%20id%3D%22lingo-sub-2259346%22%20slang%3D%22en-US%22%3EUploading%20Excel%20file%20to%20specific%20fields%20in%20Access%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2259346%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20question%20about%20Access%20and%20whether%20this%20is%20even%20possible.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20an%20Access%20database%20that%20I%20run%20a%20query%20on%20twice%20per%20month%20and%20pull%20out%20specific%20records%20that%20need%20to%20be%20reported%20to%20a%20State%20agency.%26nbsp%3B%20I%20run%20the%20query%20and%20export%20these%20records%20to%20an%20Excel%20file%20so%20that%20the%20data%20looks%20like%20this%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Excel%20download.JPG%22%20style%3D%22width%3A%20886px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F270798i921312A23F724105%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Excel%20download.JPG%22%20alt%3D%22Excel%20download.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ENow%20that%20I%20have%20the%20records%20that%20need%20to%20be%20reported%2C%20I%20must%20create%20a%20report%20with%20fixed%20field%20lengths.%26nbsp%3B%20The%20only%20way%20I%20have%20been%20able%20to%20accomplish%20this%20is%20to%20have%20an%20Access%20Database%20that%20looks%20like%20this%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22template.JPG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F270800i9E897483D628592A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22template.JPG%22%20alt%3D%22template.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EAt%20this%20point%2C%20I%20enter%20the%20data%20manually%20since%20you%20can%20see%20that%20the%20Excel%20file%20has%20three%20records%20for%20Acute%20Care%20Surgery%2C%20so%20what%20I%20do%20is%20enter%20the%20last%20name%20of%20the%20customer%20and%20their%20license%20number%20in%20the%20field%20name1%20and%20lic1%2C%20then%20the%20second%20record%20in%20name2%20and%20lice2%2C%20and%20so%20on.%26nbsp%3B%20There%20are%2030%20of%20these%20fields%20across%20the%20top%20name1%2C%20lic1...name30%2C%20lic30.%26nbsp%3B%20Once%20I%20have%20finished%20entering%20the%20information%20manually%2C%20I%20export%20it%20to%20a%20fixed%20length%20txt%20file%20so%20that%20it%20comes%20out%20in%20the%20format%20required%20by%20the%20State%20agency.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20take%20the%20rows%20of%20the%20Excel%20sheet%20and%20get%20the%20information%20into%20the%20corresponding%20field%20in%20the%20Access%20database%3F%26nbsp%3B%20I%20have%20been%20trying%20to%20figure%20out%20a%20way%20to%20either%20extract%20the%20data%20directly%20from%20one%20Access%20file%20to%20another%2C%20or%20use%20Excel%20as%20the%20intermediary%20file%20where%20I%20have%20at%20least%20isolated%20the%20information%20I%20need.%26nbsp%3B%20I've%20used%20sample%20data%20here%20in%20the%20examples%20so%20the%20customer%20information%20is%20kept%20private.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20would%20be%20appreciated.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2259346%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

I have a question about Access and whether this is even possible.

 

I have an Access database that I run a query on twice per month and pull out specific records that need to be reported to a State agency.  I run the query and export these records to an Excel file so that the data looks like this:

Excel download.JPG

Now that I have the records that need to be reported, I must create a report with fixed field lengths.  The only way I have been able to accomplish this is to have an Access Database that looks like this:

template.JPG

At this point, I enter the data manually since you can see that the Excel file has three records for Acute Care Surgery, so what I do is enter the last name of the customer and their license number in the field name1 and lic1, then the second record in name2 and lice2, and so on.  There are 30 of these fields across the top name1, lic1...name30, lic30.  Once I have finished entering the information manually, I export it to a fixed length txt file so that it comes out in the format required by the State agency.

 

Is there a way to take the rows of the Excel sheet and get the information into the corresponding field in the Access database?  I have been trying to figure out a way to either extract the data directly from one Access file to another, or use Excel as the intermediary file where I have at least isolated the information I need.  I've used sample data here in the examples so the customer information is kept private.

 

Any help would be appreciated.

0 Replies