Need Help Regarding vba code (1 Viewer)

moin555

Member
Local time
Today, 20:02
Joined
Feb 6, 2025
Messages
64
I have a school's database. I want a code that I can run on the 25th of each month, and it should print the fee challan (invoice) for all students.
Also, if any student has an arrear, it should be updated and included in the next fee.
 

Attachments

Before suggesting code - is the db opened every day of the year? Including Xmas day? Or is it open 24/7? And is the machine that hosts the FE on all the time and doesn’t go into sleep mode

Reason for asking is you need a trigger to start the code which might when the db is opened, or a timer event running in the background or a windows timer to open the db and run the code.
 
Before suggesting code - is the db opened every day of the year? Including Xmas day? Or is it open 24/7? And is the machine that hosts the FE on all the time and doesn’t go into sleep mode

Reason for asking is you need a trigger to start the code which might when the db is opened, or a timer event running in the background or a windows timer to open the db and run the code.
is it open 24/7
 
I don’t know - I’m asking you

If you are saying it is open 24/7 what happens with windows updates which require a reboot of the computer and do you have a UPS for computer and printer
 
I have a school's database. I want a code that I can run on the 25th of each month, and it should print the fee challan (invoice) for all students.
Also, if any student has an arrear, it should be updated and included in the next fee.
Are you ok with running the reports by clicking a button on the 25th or do you expect these reports to be run unattended?
 
The problem you just gave yourself is that NOW you have to remember if you already did something,... e.g. your "arrears" situation.

Your comments about accounts in arrears that trigger a specific type of update means that if you open the DB twice on the same day, you have to remember that you did something the first time that you don't want done again. I.e. double-charge of arrears. This makes it more complex.

If you have a power outage on the 25th of the month, you have to remember on every 25th of a month that you DID generate your output so that on the day of the power recovery after the DB was down on the 25th, you can remember that you didn't yet create your desired outputs. If it happens that you do some processing of updates during this output generation, you would again run in a double-processing case.

How many people can open this DB with the right to run that required output? If the answer is "more than one person" then you also have to allow for possible simultaneous actions that would trigger double-reports or double-arrears. This sounds like a situation that INVITES destructive interference in everyday operation.

Then there is the question of a database proposed to enjoy 24/7 activity, which I will CATEGORICALLY tell you is not going to happen. Every so often, because of memory leaks that clog up Windows scratchpad memory in something called Non-Paged Pool and, to a lesser extent, in Paged Pool, Windows MUST be rebooted. More directly, whether you like it or not, Windows WILL reboot - and not give you a choice - AND it will be the ugly type of reboot derived from a Blue Screen of Death. Having an Access app open during one of these forced reboots is the proverbial hole so big you could drive a Mack truck through it. This is one of the circumstance that KILLS databases - because if there is a pending update in this DB at the time that Windows takes the big dirt nap, you can corrupt your DB irretrievably. OK, admittedly Microsoft has improved the stability of Windows - but it still isn't perfect.

This concept - a 24/7 database - is fraught with peril.
 
Having an Access app open during one of these forced reboots is the proverbial hole so big you could drive a Mack truck through it. This is one of the circumstance that KILLS databases - because if there is a pending update in this DB at the time that Windows takes the big dirt nap, you can corrupt your DB irretrievably. OK, admittedly Microsoft has improved the stability of Windows - but it still isn't perfect.

This concept - a 24/7 database - is fraught with peril.

Of course our friend Moin555 meant that he would like the code built with Access and the data on any db server
No one would be so crazy to keep important data on native Access files
 

Users who are viewing this thread

Back
Top Bottom