From Excel, Open Access, Copy a cell to Access, close Access

FTM

New Member
Joined
Mar 28, 2013
Messages
40
Hello Everyone,

I want to open Microsoft Access Database using VBA from an MS Excel Spreadsheet, open a data entry form then add data to the existing database. When I have exhausted all of the lines on the spreadsheet then I want to close MS Access.

What is happening is that I have a spreadsheet that contains daily production data per part number. I want to append that data to a spreadsheet at the end of the production shift. In the past I have used the Macro Editor that is native to MS Excel and life has been good. In the event that I can't use the editor I have been quite adept in pirating code from sundry forums on the web.

Now...

I consider my "Google-Foo" to be at or above average and I've crawled all over google every way that I can think of and as of yet I have found no mention made at all of appending a database from within MS Excel. I don't write VBA code very often so most every time that I try I have to relearn most things. Is there anybody that has tried this before? Is manipulating an Access database from an Excel VBA script even possible?

Regards to everyone and thanks in advance for any assistance that can be offered.
 
xenou,

The code is indeed running almost instantaneously. I originally created the database with an export to access, linked table. I can't find a reference in MS Excel or MS Access that indicates and existing link. The .laccdb file doesn't appear until I attempt to open the database. If I open the macro editor and click the stop button then the .laccdb file goes away and I can open the database.

I know that the data being exported to the database is correct. I'm going to treat this detail as a fluke and create the next database and write an export script using the first as a model. I have scripts stacked up doing different things. I clear out data from an old form, I get data from a pair of other spreadsheets then I e-mail a report based on the data that I copied into the master spreadsheet. My plan is to write data from the master spreadsheet to a database then kick off the e-mail. We'll see how all this works out.

You have been more than kind in your assistance thus far in regards to this matter. When I get the next spreadsheet written and the export scrript running I'll let you know how it is all working out.

Regards,

FTM
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Okey dokey. I push data to and from Access/Excel all the time so you should be good to go in the end.
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,849
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top