The first record the User sees is the next record to contact.
He clicks Next Or uses the Keyboard combination Alt+N
to go to the next record to be contacted.
The Problem I am faced with:
It is likely that the next record to be contacted is NOT the next record in
the table.
Access 97 uses Page locking which Locks 2K of data rather than an individual
record. And Allows users to view the locked record.
I need the Next action to skip all currently open records and find the next
unopened record down.
Your help is really appreciated...
Marvin
Ok, I hear what you say. You have several opertors all picking a record
from the table, and you don't want two of them to pick the same record
at the same time.
First, Access 2003 does have optional, true, record-level locking. But
personally, I'm not sure I'd want to rely on that.
The problem with setting a flag in the record, is two-fold. (1) You'd
get locking conflicts anyway, when two operators pick the same record
at the same time. (2) What if the db sets a flag & then the db fails?
Maybe that flag will never get un-set, despite the fact that no
operator has actually contacted that record yet.
Here's what I'd try. See if code like the following will successfully
establish a temporary lock on the record, that can be seen by other
operators. ?????? represents the options that you'd have to play-around
with. If this worked, you'd just attach it o a "Lock this record"
button, or somesuch. If the db failed in the middle, all these locks
would naturally disappear.
(UNTESTED)
dim db as database, rs as recordset
set db = curentdb()
on error resume next
set rs = db.openrecordset ( "SELECT 1 FROM MYTABLE WHERE KEY=" &
me![key], ?????? )
select case
case 0 ' got it.
' continue.
case ??? ' oops, someone else got it.
msgbox "nope, someone else has this one!"
case else ' other (unexpected) error.
(whatever)
end select
on error goto 0
I have to go in a moment, so I might not see yor rply for several
hours.
HTH,
TC
TC - 23 Dec 2005 02:41 GMT
PS if this worked, then you could code a loop to try the lock on
following records until it got the next free one.
TC
Marvin - 23 Dec 2005 03:31 GMT
I you are saying abut the problems with Access...
I am looking for a better schema for record lokcing for all users so they
move down through the table until they reach the last record meeting the
criteria then moving back to the top record again...
The FindNext almost meets my needs... And may IF I knew how to apply it
properly...
Think of it 'ratcheting' down the table until it reaches the last record
with the field Area - 1 then move to the first record until records reach a
minimum number = x
Then change Area = 2 and starting the whole cycle over until it depletes
these recors to minimumber = x ...
> PS if this worked, then you could code a loop to try the lock on
> following records until it got the next free one.
>
> TC
TC - 23 Dec 2005 08:51 GMT
I've suggested a scheme. Give it a try!
TC
Marvin - 23 Dec 2005 03:53 GMT
> PS if this worked, then you could code a loop to try the lock on
> following records until it got the next free one.
>
> TC
>
> I am using Access 97...
Marvin - 23 Dec 2005 03:20 GMT
A new query each move next will not continue to move down the table...
It will sellect the first record that is not locked over & over... That is
what I'm attempting to wouk around
> Ok, I hear what you say. You have several opertors all picking a record
> from the table, and you don't want two of them to pick the same record
[quoted text clipped - 38 lines]
> HTH,
> TC