Access Question

D

Digi

Hi there all, I hope someone can Help me.

Firstly I am a complete Noob with access (Dont know a thing)

But I can do basic things, what i want to know is this,
I want to create a for that i can do the following, on the main for i want
to have a Update button where when clicked will goto a SET folder location
and retrieve a EXCEL document that is generated elsewhere and update the
Access Database with all values in that form deleting any old data that there
was.

It must then also update all the View fields that I have on that same form.

What I have on this is basically A excel document that is occasionally
updated. I want to use Access to easily design a easy to read view that can
use the data from Excel and use it as i need to, but be able to update
whenever I press a button just using the same file that may have been updated.

Thanks for any and all assist with this one :)
 
A

Albert D. Kallal

Create a linked table to the excel sheet.

In the query builder create a append query from this linked table to the
table that the form is bound to.


Then, in code behind that button simply go:

' delete existing data in the table that the form is bound to
currentdb.Execute "delete * from tableThatFormIsBoundTo"

' now run the append query we made:

currentdb.execute "name of append query goes here"

If the button is on the actual above form, then we should re-fresh the form.
So, add

me.Requery

So, the whole thing can be done with 3 lines of code......
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top