Need helt developing either a que-system or an effective anti-concurrency function.

And now for the quadruple-post :)

Here is the solution, this code replaces the default popup when a record is locked.

Private Sub Form_Error(DataErr As Integer, Response As Integer)
' The error code for record locking in this case is 7787
Const conErrRequiredData = 7787
If DataErr = conErrRequiredData Then
MsgBox ("This date-record has already been changed by another user, please try again.")
Response = acDataErrContinue
Else
Response = acdatadisplay
End If

End Sub
 
There is another way of skinning the cat. Each Record [Day] represents 28 time slots. What about inserting a users time slot selection into a table with a Unique Key Day/TimeSlot. If two users are looking at the same day, it does not mean that they can't book different time slots.

Unconfirmed Time slots would need to be managed and deleted if necessary.

Simon
 
To be honest, I didn't quite follow that :p but I think it's working pretty well with the method of substituting the error messages with my own routines.
Just need to get rid of a few new problems, but I have started a new thread for that :p

Thanks for all the guidance people :)
 
Inkognito,

I know it's been years, but your last post on this thread said your booking system was working pretty well. It was interesting reading the story and seeing it progress. How's it going now?

I like your identification of the error code for the record having been changed by another user. That's info I can use in my own record locking scheme. Have you found other, related error codes since then?

My two cents about the table design has to do with the 28 columns for different time slots in the day. What happens if there is a change? Say your chief loader negotiates a longer lunch and you need to change the 1:00, 1:20, and 1:40 time slots to 1:15, 1:30, and 1:45. Or what if the harbor master decides that the crew can work a longer day and can handle 31 appointments per day? Or what if some days are 23 and other days are 32? As you can see, there are a whole lot of factors, outside of your control, that can affect your table. The way that I design a time table is columnar. Each time slot is one record. Multiple time slots do not ever share one record. The table (simplified) looks something like this:

Rec. Date Time Customer Other Details...
  1. 6/1/14 8:00 John Smith
  2. 6/1/14 8:20 Bill Baggins
  3. 6/1/14 8:40 Jim Johnson
  4. 6/1/14 9:00
  5. 6/1/14 9:20 Ken Harris
So you see, if there is any data in the Customer field, the time slot is taken. If it is blank, it's still available. A lock can be put on one record at a time. It doesn't block anyone from reading or writing to any of the other records, even on the same day.

Regards,
Marvin M :cool:
 

Users who are viewing this thread

Back
Top Bottom