VBA Code to execute once per period in table

  • Thread starter Thread starter McDuck
  • Start date Start date
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
 
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.
 
Back
Top