quietstormtw
Programmer
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
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