VBA Code to execute once per period in table

M

McDuck

GREETINGS!!! TIA (hopefully)

I have a table that has billing periods in it...i.e.
Term days
day 1
week 7
mo 30

etc

I need to make a fool proof way to run an update every time the app is
started, and run update queries to roll over past due balances, PLUS new
balance.

Anybody have something to this end? Willing to share?

Duck
 
W

Wayne Morgan

It's not 100% fool proof, but you could also change the setting in Tools|Startup to
prevent the users from bypassing your startup form.

In the OnLoad event of you startup form you could run the update queries.

Dim db As DAO.Database
Set db = CurrentDb
db.Querydefs("MyUpdateQuery").Execute dbFailOnError
db.Querydefs("My2ndUpdateQuery").Execute dbFailOnError
Set db = Nothing

If the queries aren't stored queries, you could use a SQL statement as well and execute
that.
 

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