I think I want to use an AFTER INSERT and AFTER UPDATE trigger - but I'm not
sure of the right sequence - or even if this is a viable way to accomplish
my mission.  I realize that I could do this with EEPs or a command routine
after editing the form - but the user can edit the form from a number of
places, edit these fields within different forms, and they might also be
entering this information when ADDing a new record with ENTER USING.

The user can enter appointment times as hours BETWEEN starttime AND endtime.
For ease of data entry, I want them to be able to enter either time value as
1030 or 0400 - with NO A or P and NOT in military time.

(I digress a little - it would be cool if R:BASE  had a TIME setting, along
the lines of the CENTURY and YEAR settings that would allow me to just set
this up in code like I can do with the date - a default AM or PM range...)

Since all appointments will be during the normal business workday, the
default values from 7:00am - 12:59pm work just fine using this method.  The
problem occurs with times between 01:00pm and 06:59pm - and I just want to
change the value the user entered to be:
    SET VAR vApptStartTime = (ADDHR(.vApptStartTime ,12))

Here's my question about ADDING a new record:
Can I issue an UPDATE statement on the same brand new record within the
Trigger using the AFTER INSERT syntax?

When UPDATING an existing record:
Can I issue an UPDATE statement on the SAME record that is currently being
UPDATED?

Part of the trigger also checks to be sure that the Ending time is AFTER the
Starting time - so what if it breaks the rule (which can only be checked
after the trigger has added 12 hours in some cases)?

TIA for any words of wisdom!
Sami

-----------------------------------------------------------
Sami Aaron
Software Management Specialists
19312 W 63rd Terr
Shawnee KS  66218
913-915-1971
http://www.softwaremgmt.com

Reply via email to