Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to MS-Access - VB Script Help

Status
Not open for further replies.

MJV

Programmer
Oct 2, 2002
10
CA
I've created an MS-Access DB that will import data sent from our AS/400 to a network drive. The VB script I've written deletes all records from the tables then imports the data from the network drive into tables. This works fine.

The question is how do I create a button to run this VB script when the user has the Access DB open?

Thanks,

MJV
 
Create a form, then add a button to it. Click escape to bypass the wizard. Right click and rename it to something following your naming convention. Go into the code editor and put in a call to the function in the Click event of the button and any appropriate error trapping, which presumably is in a module.

John
 
Thanks...I got it working.

MJV
 
MJV,

Be careful of file bloat. WHen you delete records Access does not shrink the file size. The only way to do this is to compact the database.

Is there a way to do this that doesn't involve blowing everything away and starting from scratch? If not, I would suggest making a database just for this table and doing the continuous delete/append routine in that other database. Then you can link from your main database to that one. Less chance of corruption, less worry about bloating in your main database.

Jeremy =============
Jeremy Wallace
Designing and building Access databases since 1995.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top