Full Version: How Long DB Is Open For
UtterAccess Forums > Microsoft® Access > Access Date + Time
1234
I am sure that this type of question would have been asked previously but i can't seem to find it.
Is there a way of capturing the time when the actual database was opened? And can anybody tell me if there is a way of showing on a form how long the database has been open? (not just that specific form)
Oknow using =Now() will give you the time when a form was opened but as the user travels around certain forms are closed and opened thus the time is refreshed.
I'm struggling, can anybody help!!!
Cheers,
Paul J
dannyseager
this is easier than you think....
When the DB opens make it open a form in hidden mode.. then you can just assume that that when the form opens is when the user logs into the DB and when the form closes is when they exit the DB
1234
Danny,
any thanks for the help, sometimes i look for complicated when there's an easier answer. Then all i need to do is show the current time, minus them both and this will give me how long the DB has been open. PERFECT
Am i right in thinking that to hide a form you right click into properties and select 'Hidden'. BUT when i do this my form which i choose to show how long the DB has been open cannot read from the hidden form. You get the &Name error.
Am i going wrong somewhere?
Cheers for your help with this.
Paul J
dannyseager
check out this example (don't hold shift when opening to demo it).
The autoexec macro loads the form hidden and then the form "does it stuff" on load and unload.
You may want to convert the time in the DB into minutes and hours (I've left it as seconds to keep it simple.)
1234
Danny,
That looks perfect to me - many thanks for the DB example.
I will work it into my DB and as long as there isn't any problems i'd like to say "thank you...... till next time!!"
Much appreciated mate.
Paul J
dannyseager
you're welcome.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.