Dennis Piccioni
9-Feb-2005, 09:45 AM
Hi Alan,
I noticed a syntactical error that could cause this problem: you are
using Field_Current_Value and Field_Changed_Value, but the keyword
File_Field. You should use the Field keyword with these messages and the
File_Field keyword with their File_Field_xxx equivalents
(File_Field_Current_Value and File_Field_Changed_Value).
Regards,
Dennis
-----Original Message-----
From: Alan Dowley [mailto:alan@ashfieldsoftware.com]
Posted At: Wednesday, February 09, 2005 12:16 AM
Posted To: visual-dataflex
Conversation: VDF or back to BASIC
Subject: VDF or back to BASIC
Is there a code that will unravel simple problems with VDF that should
work
but don't?
Windows XP sp2
VDF 10.1
Could some please tell me why the following will not work....
----------------------------------------------------------------------
View . (Main DD is Payroll)
Header - saves ok... so far ..so good
dbGrid. (Main DD is Payroll) (Index 1)
dbForm Gross_Pay dbForm Deductions dbForm Net_Pay
----------------------------------------------------------------------
The dbGrid displays records from Jobs_DD - Empl_DD
each line item lists: Job_No - Service_Name - Total_Time - Empl_Pay -
Total_Pay (Payroll.Total_Pay)
Selecting the job enters the information ok. Empl_Pay is entered
depending
on Empl selected in the header.... works great
Now the crunch bit....
The following code SHOULD take the value of Empl_Pay * Total_Time and
enter
the sum into Total_Pay
Procedure Adjust_Display_Total
Number nQty
Number nAmnt
Number nTpay
Get Field_Current_Value File_Field Jobs.Total_time To nQty
Get Field_Current_Value File_Field Empl.Pay_rate To nAmnt
Move (nAmnt*nQty)To nTpay
Set Field_Changed_Value File_Field Payroll.Total_pay To nTpay
End_Procedure // Adjust_Display_Total
it doesn't....
If I set the field Total_Pay to display only in the Payroll_DD the
calculation does not work and still shows 0.00 (and nothing is entered
into
the Gross_Pay field)
If I remove the display only, the calculation does not work and the
Total_pay remains at 0.00, BUT the Gross_Pay shows 5.00 instead of the
expected 16.00 - 2 x 8 = 16 (nAmnt*nQty)
I have tried setting this code to run on Entry and Exit of
Empl_Pay/Total_Time and Payroll.Total_Pay but to no avail.
DDO Structure for the view:
Client_DD
Empl_DD
Services_DD
Payroll_DD (Main DDO)
Empl_DD (Server)
Jobs_DD
Empl_DD (Server)
Client_DD (Server)
Services_DD (Server)
I can't understand why the calculations will not work in the dbGrid when
I
have calculations working in the final 3 dbForms
I have tried so many different ways of trying to get this working I'm
fast
running out of ideas.... any help please!!!
I noticed a syntactical error that could cause this problem: you are
using Field_Current_Value and Field_Changed_Value, but the keyword
File_Field. You should use the Field keyword with these messages and the
File_Field keyword with their File_Field_xxx equivalents
(File_Field_Current_Value and File_Field_Changed_Value).
Regards,
Dennis
-----Original Message-----
From: Alan Dowley [mailto:alan@ashfieldsoftware.com]
Posted At: Wednesday, February 09, 2005 12:16 AM
Posted To: visual-dataflex
Conversation: VDF or back to BASIC
Subject: VDF or back to BASIC
Is there a code that will unravel simple problems with VDF that should
work
but don't?
Windows XP sp2
VDF 10.1
Could some please tell me why the following will not work....
----------------------------------------------------------------------
View . (Main DD is Payroll)
Header - saves ok... so far ..so good
dbGrid. (Main DD is Payroll) (Index 1)
dbForm Gross_Pay dbForm Deductions dbForm Net_Pay
----------------------------------------------------------------------
The dbGrid displays records from Jobs_DD - Empl_DD
each line item lists: Job_No - Service_Name - Total_Time - Empl_Pay -
Total_Pay (Payroll.Total_Pay)
Selecting the job enters the information ok. Empl_Pay is entered
depending
on Empl selected in the header.... works great
Now the crunch bit....
The following code SHOULD take the value of Empl_Pay * Total_Time and
enter
the sum into Total_Pay
Procedure Adjust_Display_Total
Number nQty
Number nAmnt
Number nTpay
Get Field_Current_Value File_Field Jobs.Total_time To nQty
Get Field_Current_Value File_Field Empl.Pay_rate To nAmnt
Move (nAmnt*nQty)To nTpay
Set Field_Changed_Value File_Field Payroll.Total_pay To nTpay
End_Procedure // Adjust_Display_Total
it doesn't....
If I set the field Total_Pay to display only in the Payroll_DD the
calculation does not work and still shows 0.00 (and nothing is entered
into
the Gross_Pay field)
If I remove the display only, the calculation does not work and the
Total_pay remains at 0.00, BUT the Gross_Pay shows 5.00 instead of the
expected 16.00 - 2 x 8 = 16 (nAmnt*nQty)
I have tried setting this code to run on Entry and Exit of
Empl_Pay/Total_Time and Payroll.Total_Pay but to no avail.
DDO Structure for the view:
Client_DD
Empl_DD
Services_DD
Payroll_DD (Main DDO)
Empl_DD (Server)
Jobs_DD
Empl_DD (Server)
Client_DD (Server)
Services_DD (Server)
I can't understand why the calculations will not work in the dbGrid when
I
have calculations working in the final 3 dbForms
I have tried so many different ways of trying to get this working I'm
fast
running out of ideas.... any help please!!!