Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Run a fuction when a specific field in a table is update
Message
 
To
26/09/1998 06:17:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00141105
Message ID:
00141160
Views:
29
You can do this in a stored procedure called in the field validation rule. For example; put myRule(DateAndHourIn, DateAndhourOut) in the field validation rule for DateAndhourOut, and enter the following code in a stored procedure in the database:
procedure myRule
lparameter dtTimeIn, dtTimeOut
insert into test2(TotalTime) values(((dtTimeOut - dtTimeIn)/60)/60)
return .t.
This would record the elapsed time in hours in a table called test2 whenever the DateAndhourOut field is changed.

HTH

>Hi All
>
>I have a table with some fields:
>dateandhourin dateandhourout employee dep jobb
>DT DT N N N
>When the field hourout is filled with a datetime I want
>to run a function to do some calculation on the record.
>The result off my calculation is put into another table.
>
>I dont think I can use Triggers.
>I dont think I can use Field validate
>
>Is there a solution for my problem
>
>Best regards
>Per Simmersholm
kenweber
GCom2 Solutions
Microsoft Certified Professional

Previous
Reply
Map
View

Click here to load this message in the networking platform