version check code?

joe789

Registered User.
Local time
Today, 15:15
Joined
Mar 22, 2001
Messages
154
Hi Folks,

I have a form that opens via AutoExec with a unbound textbox inside of it set to a default value of '1' that is locked so the user cannot change it. I have a query that runs automatically that places the max version number from a SQL linked table into a table. I am trying to figure out how to write a piece of code that would compare those two values so that if they are the same the individual can continue; otherwise, if not the indivdual is prompted with a msgbox stating their version is wrong. I am having issues/struggling with trying to figure out how to call in the value from the query/table to compare it to the textbox.

Any help would be greatly appreciated

Thank you very much,

Joe
 
There are a million ways to skin this cat. Here is what I do:

I have a split FE/BE database. In your case your BE is SQL-based, which is not a big issue - in fact it fits right in with what I suggest. It will work perfectly.

My FE database has a switchboard form because my users NEVER see the details behind the scenes. They NEVER see the database window or the object navigation pane.

SO... in the code for my switchboard's class module, I have a public string constant that contains my versioning string for the FE code. When I make a new version, my "action checklist" includes updating the FE "official" version number. I have a form in the FE that I use to maintain the BE table that tracks "official versions."

In my switchboard's Form_Open routine, I do the SQL retrieve of the version number information for the BE form. I compare the two. If they match, you have the current version. If not, you don't. So, since Form_Open is one of the event entry points that allows a Cancel value, I do a Cancel=TRUE if the FE version does not make the grade.

In my particular case, my business rules allow me to have a FE version greater or equal to the most recent BE version marked for "Mandatory Update." I have a flag in my version history table that says "UpdateRequired" so I can run a separate query for the version number string for the "last mandatory update" and a query for the "last update (mandatory or not)."

At my site, the business rule says that to be legal, the FE has to be valid for a version no older than the last mandatory update. Then, it is up to me to set the mandatory update flag whenever I make changes that force the issue - like a BE design change that if I don't force the FE update, I would break something. But minor bug fixes that don't involve the BE data don't always require a mandatory update if the user is not doing things that require the bug fix. Frequently, this happens if the user is running in a low-privilege role and the bug fix relates to high-privilege functions.

Note, however, that other threads on this forum address a totally different approach - a way to launch access using a script to compare versioning information and automatically copy-then-load the newest version from the correct location every time you run. That is ALSO a valid method to keep versions updated.
 

Users who are viewing this thread

Back
Top Bottom