
Signature
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com
Hi Alex,
Many thanks for responding.
> as i understand you - following solution can be implemented. in tasks
> table
Yes, the basic info is:
tblTasks [TaskID, ScheduleDate, StartTime, StopTime, Description]
> you can add a new field where your store date/time of record update.
Yes, and this info can be added/edited/deleted via both normal Access forms
and Access form with the ActiveX control.
> on a form with ctMDay at form timer event you check every say 2 mins if
> any changes occured, if yes - then repopulate ctMDay
OK, sounds good. I see two form properties "On Timer" and "Timer Interval".
So, to make sure the displayed data is accurate, every couple of minutes, I
check to see if anything has changed (a table dirty property?) and then
redraw the calendar if necessary.
Next, about record locks to avoid race conditions. Suppose a user wants to
drag a task to a new data/time using the ActiveX control. I think the steps
are something like the following.
- attempt to lock the record
- if the lock fails, then abort the drag-and-drop with a message that the
record is locked
- if the lock succeeds, then upate the record, then release the lock
Am I on the right track? If so, two quick questions.
- What is the ADODB code snippet to lock and unlock a record?
- The ActiveX control includes many events which I assume are more or less
industry standard. At what time do I abort a failed drag-and-drop? Do I
let them do the drag-and-drop, and then move it back if unsuccessful, or
should I abort the drag-and-drop before it actually begins to move?
Best,
Christopher
Alex Dybenko - 05 Jan 2005 16:03 GMT
Hi Christopher,
>> you can add a new field where your store date/time of record update.
> OK, sounds good. I see two form properties "On Timer" and "Timer
> Interval". So, to make sure the displayed data is accurate, every couple
> of minutes, I check to see if anything has changed (a table dirty
> property?) and then redraw the calendar if necessary.
what i suggest is to save date/time of record update, so getting Max() of
this field you will know if any data changed
> Next, about record locks to avoid race conditions. Suppose a user wants
> to drag a task to a new data/time using the ActiveX control. I think the
[quoted text clipped - 6 lines]
>
> Am I on the right track? If so, two quick questions.
yes
> - What is the ADODB code snippet to lock and unlock a record?
you can open recordset with locked option, see online help for proper
constant name
> - The ActiveX control includes many events which I assume are more or less
> industry standard. At what time do I abort a failed drag-and-drop? Do I
> let them do the drag-and-drop, and then move it back if unsuccessful, or
> should I abort the drag-and-drop before it actually begins to move?
i am not so familiar with ctMDay, but i think it should be Cancel argument
in one of D&D events, which you can use

Signature
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com
Christopher Glaeser - 05 Jan 2005 19:01 GMT
> what i suggest is to save date/time of record update, so getting Max() of
> this field you will know if any data changed
Good idea. I was planning to add record-level date/time update info to all
my major tables anyway. (It's nice to know that someone modified an Invoice
or WorkOrder months after it was created). Is there a modular way to do
this, or do I just add a couple lines of code to each "After Update" event
of affected forms?
> i am not so familiar with ctMDay, but i think it should be Cancel argument
> in one of D&D events, which you can use
Yes, I see the following Cancel methods.
- CancelDrop: Prevents an appointment from being dropped into a new time or
column.
- CancelSelect: Prevents an appointment from being selected.
CancelDrop should do the trick. There are quite a few events associated
with the control so now I'll have to read through them and determine which
one(s) to trigger on. This one looks promising ...
- AppPreDrop: Occurs just before an appointment is either created, or
dropped (with the mouse) into a new column or start time.
Thanks again for your assistance. This project is starting to look quite
nice.
Best,
Christopher
Alex Dybenko - 05 Jan 2005 20:51 GMT
Hi Christopher,
> Good idea. I was planning to add record-level date/time update info to
> all my major tables anyway. (It's nice to know that someone modified an
> Invoice or WorkOrder months after it was created). Is there a modular way
> to do this, or do I just add a couple lines of code to each "After Update"
> event of affected forms?
normally, when you have a bound form to this table you just use beforeupdate
event to assign textbox control, bound to "LastUpdated" field to date():
me!LastUpdated=date()
HTH

Signature
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com