Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resetting Global Variables

Status
Not open for further replies.

quietstormtw

Programmer
Sep 16, 2002
81
US
Hi all,

I have a DB that is being utilized by several users at once. They all use the same form, which uses the same query...but with different filters. I'm having a problem with the Agency_Seq field. I have 30 different agencies, each agency could have any number of records...Agency_Seq.

Example - User1 opens the form for Agency1...the agency has 5 records. The user takes a break or something...and doesn't use the Copy or Add record function immediately. User2 enters the form for Agency2, which has 10 records. User1 gets back to the DB, clicks on the Copy record button...which then performs a DMax on the current query's Agency_Seq field, then adds 1 to that number. However, User1 is unaware that User2 has performed a new query...and the Agency_Seq is now 11, instead of 6.

To combat this problem, I opted to use a global variable, when the form is opened...to capture the current query's Agency_Seq number. Which seems to work just fine, however, if the user were to attempt to use the Copy or Add Record buttons again, in the same session...the global variable is still set to the initial value...

Is there anyway to reset this variable? Recalc? Requery?

Thanks in advance

[peace]
 
Access doesn't really like having multiple users ... you should split the database so each user has his/her own copy of the forms/queries/other front items and the data all lives on the server in the backend.
 
Hey Solun,

I appreciate your response...but there is no way that any programmer should be building individual front ends for each of the users in the company. Do you realize the maintenance that would have to be done? Not to mention the roll-outs of new versions!

Thanks again for your response...although I know there has to be a more reasonable way to resolve this one.

 
I know there has to be a more reasonable way to resolve this one
Splitting the DB and each user having an own local copy of the FE is the safer way.
Tons of threads (and even FAQ) on how to automate the roll-out of new versions.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top