Message box only first time DB is opened

ChronicFear

Registered User.
Local time
Yesterday, 20:16
Joined
Oct 18, 2007
Messages
66
This forum is so incredibly helpful! Here is my newest question:

Is it possible to check if a given user is opening the db for the first time?

What I would like to do is have a message box distributed with my updates that details what the changes are. So the first time each unique users opens the db, they will get the box. Otherwise it will lie dormant.

Thanks!
CF
 
Have a hidden table with one field (a yes/no field).

Set the form to be the first thing opened and have code that checks to see if that checkbox is checked. If so, it just closes the other form and opens the main form. If not then it continues on with the form you want to show one time and have the code update the box so that the next time they open it, it will not display.
 
Bob, I'm surprised you suggest making a table with one field, which I'm assuming will only have a single record in it, rather than creating a user defined property...

However, I don't believe either of these would work - if I am assuming correctly multiple users will be opening the same MDB file.

If this is the case, then you would need a table that keeps track of user names - hopefully you can get this from the logged in name in the network API calls - if not, then we'd have to come up with another solution.

If you are using a network and having multiple users opening the exact same MDB file, then here is what I would do;

have the database open your "one time only form" - no matter what happens, then in the procedure that I am assuming is going to fire, most likely on the On_Open event.

I would create an IF condition that grabs the log-in ID of the network user, and checks it against a User table, if the username is not there, add it and fire the rest of your code, if it is there, close the form, but not before opening the "main" form.

You can also just open the "main" form and make your "one time only" form a Modal dialog form and whenever the "main" form opens run the check for User name, if there, do nothing out of the ordinary, if not there, then add it, and open the "one time only form" which hides all other objects until the user closes the 1X form.
 
Presuming the application is split and each user has their own copy of the front end, Bob's idea will work fine (the table would have to be in the FE of course). Multiple users should not be opening the same copy of the MDB anyway, so Bob probably made that assumption.
 
My bad, you're absolutely correct. However, this begs the question, what happens when someone new needs to access the database, do they just copy it from someone elses machine? I guess again that assumes there is a core FE file located on the server, and any development changes that are happening gets propogated to all files (including the FE file located on the server that everyone uses when they first start using the application). But all of these assumptions mean the person developing the DB knows enough about what they are doing that they probably wouldn't have to ask "how to open a form one time for each user" in the first place.

Presuming the application is split and each user has their own copy of the front end, Bob's idea will work fine (the table would have to be in the FE of course). Multiple users should not be opening the same copy of the MDB anyway, so Bob probably made that assumption.
 
Here is a very quick example I made for you. The code needs cleaned up and some err hanlding but this is just an example db. let me know if it suites your needs.
 

Attachments

Most of us put a master copy of the front end on the server and use a utility that copies that file to the user's PC any time a new version is placed there. In that scenario, a new user would be getting a fresh copy, and thus would see the one-time form.
 
This is all excellent, everyone. Thank you so much for your responses! I think I'll be able to get a working model up and running from this. Rep points for all. -CF
 
if yuo are having multiple users, assuming they are logging in to Windows differently, save the status flag in the registry

look at savesetting and getsetting - its dead easy
 

Users who are viewing this thread

Back
Top Bottom