Sorry for the long post. Or what is about to be and I must be getting close
to overdoing it for the day in the NG but I'm at another dead end.
I've tried to going through all the help manuals (across a couple of VDF
versions) to find the reason for the error but the links to:
developingdatabaseapplications.chm::/the_data_dictionary_operation_integers.htm

in the .chm help files (On the System and Program Errors List under Error
4402) do not work for me to further track it down, nor can I find the
reference pages the initial error code refers to by searching.
Below is the error message I get in full, then my code from the view in
full.
The database tables for these files were all linked via the 'job_sheet'
field originally but I have since removed this link on all tables and
recompiled to no avail.
If anyone would like to see the database DEF's, FD's or any other part
please let me know.

Brendon O'Hanlon



<----------------------------------------START
ERROR------------------------------------------------>
DDO re-entrant operation attempted
Message =request.save. Object=MAIN.CLIENT_AREA.OPRINTRECOVERY.PRINTSUB_DD
Current Operation_mode is 1
Current Operation_origin is 130 MAIN.CLIENT_AREA.OPRINTRECOVERY.PRINTREC_DD

Technical Details
Error Number: 4402
Line Number: 34487
<-----------------------------------------END
ERROR-------------------------------------------------->


<------------------BELOW IS THE ENTIRE CODE FROM THE
VIEW ------------------------------->

//AB/ Project oPrintRecovery
//AB/ Object prj is a View_Project
//AB/ Set Size to 274 439
//AB/ Set ProjectName to "oPrintRecovery"
//AB/ Set ProjectFileName to "oPrintRecovery.vw"
//AB/ Set GenerateFileName to "NONAME"

// Project Object Structure
// oPrintRecovery is a dbView
// Printrec_DD is a DataDictionary
// Printsub_DD is a DataDictionary
// Printtrn_DD is a DataDictionary
// oPrintrec_Job_Sheet is a dbForm
// oPrintrec_Date is a dbForm
// oPrintrec_Status is a dbForm
// oPrintrec_Total_Labour is a dbForm
// oPrintrec_Total_Material is a dbForm
// oPrintrec_Date_Required is a dbForm
// oPrintrec_Total is a dbForm
// frmUnitCost is a Form
// frmTotalUnits is a Form
// btnSave is a Button
// btnClear is a Button
// btnCancel is a Button
// btnPrint is a Button
// CrystalPrintRec is a CrystalReport
// oPrintsub_Grid is a dbGrid
// oDbGrid1 is a dbGrid

// Register all objects
Register_Object btnCancel
Register_Object btnClear
Register_Object btnPrint
Register_Object btnSave
Register_Object CrystalPrintRec
Register_Object frmTotalUnits
Register_Object frmUnitCost
Register_Object oDbGrid1
Register_Object oPrintRecovery
Register_Object oPrintrec_Date
Register_Object oPrintrec_Date_Required
Register_Object oPrintrec_Job_Sheet
Register_Object oPrintrec_Status
Register_Object oPrintrec_Total
Register_Object oPrintrec_Total_Labour
Register_Object oPrintrec_Total_Material
Register_Object oPrintsub_Grid
Register_Object Printrec_DD
Register_Object Printsub_DD
Register_Object Printtrn_DD

//AB-IgnoreStart
Use dfClient.pkg
Use DataDict.pkg
Use dfEntry.pkg
Use Windows.pkg
Use dfTable.pkg
//AB-IgnoreEnd

//AB-IgnoreStart
Use PRINTREC.DD
Use PRINTSUB.DD
Use PRINTTRN.DD
//AB-IgnoreEnd


DEFERRED_VIEW Activate_oPrintRecovery FOR ;
;
Object oPrintRecovery is a dbView
Set Border_Style to Border_Thick
Set Color to 6467839
Set Label to "Print Cost Recovery View"
Set Location to 2 3
Set Size to 242 414
Set piMaxSize to 242 414
Set piMinSize to 242 414

//AB-DDOStart

Object Printrec_DD is a Printrec_DataDictionary

//AB-StoreStart

//AB-StoreEnd

End_Object // Printrec_DD

Object Printsub_DD is a Printsub_DataDictionary
Set DDO_Server to Printrec_DD
Set Constrain_File to Printrec.File_Number

//AB-StoreStart
Send DefineExtendedField Field printsub.Desc
Procedure OnConstrain
string sFilter
get psFilter to sFilter
Constrain printsub.Job_sheet eq sFilter
End_Procedure
//AB-StoreEnd

End_Object // Printsub_DD

Object Printtrn_DD is a Printtrn_DataDictionary
Set DDO_Server to Printsub_DD
Set Constrain_File to Printsub.File_Number

//AB-StoreStart
Send DefineExtendedField Field printtrn.Description
Procedure OnConstrain
string sFilter
get psFilter to sFilter
Constrain printtrn.Job_sheet eq sFilter
End_Procedure
//AB-StoreEnd

End_Object // Printtrn_DD

Set Main_DD to Printrec_DD
Set Server to Printrec_DD

//AB-DDOEnd

Object oPrintrec_Job_Sheet is a dbForm
Entry_Item Printrec.Job_sheet
Set Label to "Job Sheet:"
Set Size to 13 78
Set Location to 4 45
Set Label_Col_Offset to 3
Set Label_Justification_Mode to jMode_Right

//AB-StoreStart
Procedure OnChange
string sValue sStatus
integer sTotal
get Field_Current_value of Printrec_DD Field printrec.Job_sheet
to sValue
get Field_Current_value of Printrec_DD Field printrec.Status
to sStatus
// shadowing
if ((sStatus = "P") or (sStatus = "")) begin
send shadow_me false sStatus
end
else begin
send shadow_me true sStatus
end
// end shadowing

if (sValue > '') begin
//get GetTotalUnits sValue to sTotal
//set value of frmTotalUnits to sTotal

send ChangeFilter sValue

end
End_Procedure

Function GetTotalUnits number job_no returns number
number tally
clear printsub
move job_no to printsub.Job_sheet
repeat
find gt printsub by index.1
if ((found) and (printsub.Job_sheet = job_no)) begin
move (tally + printsub.Qty) to tally
end
until ((not(found)) or (printsub.Job_sheet <> job_no))
Function_Return tally
End_Function
//AB-StoreEnd

End_Object // oPrintrec_Job_Sheet

Object oPrintrec_Date is a dbForm
Entry_Item Printrec.Date
Set Label to "Date Ordered:"
Set Size to 13 66
Set Location to 4 316
Set Label_Col_Offset to 3
Set Label_Justification_Mode to jMode_Right
End_Object // oPrintrec_Date

Object oPrintrec_Status is a dbForm
Entry_Item Printrec.Status
Set Size to 13 13
Set Location to 4 388

//AB-StoreStart
set shadow_state to true
//AB-StoreEnd

End_Object // oPrintrec_Status

Object oPrintrec_Total_Labour is a dbForm
Entry_Item Printrec.Total_labour
Set Label to "TOTAL LABOUR COST:"
Set Size to 13 78
Set Location to 141 323
Set Label_Col_Offset to 3
Set Label_Justification_Mode to jMode_Right

//AB-StoreStart
set points to 2
//AB-StoreEnd

End_Object // oPrintrec_Total_Labour

Object oPrintrec_Total_Material is a dbForm
Entry_Item Printrec.Total_material
Set Label to "TOTAL MATERIAL COST:"
Set Size to 13 78
Set Location to 156 323
Set Label_Col_Offset to 3
Set Label_Justification_Mode to jMode_Right

//AB-StoreStart
set points to 2
//AB-StoreEnd

End_Object // oPrintrec_Total_Material

Object oPrintrec_Date_Required is a dbForm
Entry_Item Printrec.Date_required
Set Label to "Date Required:"
Set Size to 13 66
Set Location to 142 69
End_Object // oPrintrec_Date_Required

Object oPrintrec_Total is a dbForm
Entry_Item Printrec.Total
Set Label to "TOTAL JOB COST:"
Set Size to 13 78
Set Location to 186 323
Set Label_Col_Offset to 3
Set Label_Justification_Mode to jMode_Right

//AB-StoreStart
set points to 2
Procedure OnChange
float sValue sQty
get value of self to sValue
get value of frmTotalUnits to sQty
if ((sValue/sQty) > 0) set value of frmUnitCost to
(sValue/sQty)
else set value of frmUnitCost to 0
send beginning_of_data of oPrintsub_Grid
send beginning_of_data of oDbGrid1
End_Procedure
//AB-StoreEnd

End_Object // oPrintrec_Total

Object frmUnitCost is a Form
Set Label to "TOTAL COST PER UNIT:"
Set Size to 14 78
Set Location to 170 323
Set Label_Col_Offset to 3
Set Label_Justification_Mode to jMode_Right

//AB-StoreStart
set Form_Justification_Mode item 0 to FORM_DISPLAYRIGHT
//OnChange is called on every changed character
//Procedure OnChange
// String sValue
//
// Get Value To sValue
//End_Procedure // OnChange
//AB-StoreEnd

End_Object // frmUnitCost

Object frmTotalUnits is a Form
Set Label to "TOTAL UNITS:"
Set Size to 13 85
Set Location to 205 59
Set Label_Col_Offset to 3
Set Label_Justification_Mode to jMode_Right

//AB-StoreStart
//OnChange is called on every changed character
//Procedure OnChange
// String sValue
//
// Get Value To sValue
//End_Procedure // OnChange
//AB-StoreEnd

End_Object // frmTotalUnits

Object btnSave is a Button
Set Label to "Save"
Set Location to 204 300

//AB-StoreStart
// fires when the button is clicked
Procedure OnClick
// start: cost update
// whats the total average
float unit_total
float unit_price
get value of frmTotalUnits to unit_total
get value of frmUnitCost to unit_price


integer i iCount iCols
float sQty
string sValue
// start: printsub loop
get item_count of oPrintsub_Grid to iCount
get line_size of oPrintsub_Grid to iCols
for i from 0 to (iCount-1)
get value of oPrintsub_Grid i to sValue
get value of oPrintsub_Grid (i+2) to sQty
send info_box sValue
send update_costs sValue sQty
move ((i+iCols)-1) to i
loop
// end : printsub loop



// end : cost update

//set field_changed_value of Printrec_DD Field printrec.Status to
"C"
//send Request_Save_No_Clear
End_Procedure // OnClick

Procedure update_costs string inm_code float quantity_made float
cost_pu
open inmaster
clear inmaster
move inm_code to inmaster.Code
find eq inmaster by index.1
if (found) begin
// update the unti stuff here
end
Procedure_return
End_Procedure
//AB-StoreEnd

End_Object // btnSave

Object btnClear is a Button
Set Label to "New"
Set Location to 4 126

//AB-StoreStart
// fires when the button is clicked
Procedure OnClick
number job_no
date sDate

open sysfile
move sysfile.Date to sDate
close sysfile

//send shadow_me true

clear printrec
move "999999" to printrec.Job_sheet
find lt printrec by index.1
if (found) move printrec.Job_sheet to job_no
else move 0 to job_no

send Request_Clear
set Field_Changed_value of Printrec_DD Field printrec.Job_sheet
to (job_no + 1)
set Field_Changed_value of Printrec_DD Field printrec.Date
to sDate
set Field_Changed_Value of Printrec_DD Field printrec.Status
to "*"
set Field_Changed_Value of Printrec_DD Field printrec.Requested
to "TEST"
send Request_Save_No_Clear



End_Procedure // OnClick
//AB-StoreEnd

End_Object // btnClear

Object btnCancel is a Button
Set Label to "Cancel"
Set Location to 204 351

//AB-StoreStart
// fires when the button is clicked
Procedure OnClick
send Request_Cancel
End_Procedure // OnClick
//AB-StoreEnd

End_Object // btnCancel

Object btnPrint is a Button
Set Label to "Print"
Set Location to 204 248

//AB-StoreStart
// fires when the button is clicked
Procedure OnClick
send Run_report to CrystalPrintRec
set field_changed_value of Printrec_DD Field printrec.Status to "P"
send Request_Save_No_Clear
End_Procedure // OnClick

Object CrystalPrintRec Is A CrystalReport
Set Report_Name To "Print_Recovery.rpt"
Set Report_View_Id To (Parent(Self))
// Procedure : OnInitializeReport
// Purpose : This is a hook message sent by the Open_report
procedure. You may use this
// procedure to set selection values, print options,
etc. This procedure is
// intended for augmentation; it has no action by
default.

Procedure OnInitializeReport
String sSelection sSelection1
// Create the selection formula string.
String sJob
Get value of oPrintrec_Job_sheet To sJob
//If (Trim(sShipHdr)<>"") ;
Move (sSelection+(If(sSelection<>""," and
",""))+"{printrec.Job_Sheet} = "+(Trim(sJob))) To sSelection
//Move (sSelection+(If(sSelection<>""," and
",""))+"{printrec.Job_Sheet} = "+'"'+(Trim(sJob))+'"') To sSelection
//Move (sSelection+(If(sSelection<>""," and
",""))+"{printrec.Job_Sheet} = '1'") To sSelection
// Set the selection formula.
Set SelectionFormula To sSelection
// Set the print destination.
Set Output_Destination To WQL_PRINT_TO_WINDOW
End_Procedure // OnInitializeReport
End_Object // Crystalpacknote
//AB-StoreEnd

End_Object // btnPrint

Object oPrintsub_Grid is a dbGrid
Set Main_File to Printsub.File_Number
Set Server to Printsub_DD
Set Size to 50 395
Set Location to 18 6
Set Wrap_State to TRUE

Begin_Row
Entry_Item Printsub.Code
Entry_Item Printsub.Desc
Entry_Item Printsub.Qty
End_Row

Set Form_Width item 0 to 87
Set Header_Label item 0 to "Code"

Set Form_Width item 1 to 229
Set Header_Label item 1 to "Desc"

Set Form_Width item 2 to 72
Set Header_Label item 2 to "Qty"


//AB-StoreStart

Procedure End_Construct_Object
Integer iOrdering
Forward Send End_Construct_Object
Get Ordering To iOrdering
If (Server(Self) <> (Main_DD(Self))) Begin
Set Ordering Of (Server(Self)) To iOrdering
End
End_Procedure


//set auto_regenerate_state to true
Procedure Entering
string js_no js_status
get value of oPrintrec_Job_Sheet to js_no
get value of oPrintrec_Status to js_status
if (trim(js_no) <= '') begin
send info_box "You must create a new header number"
set focus of btnClear to true
//Procedure_Return
end
if (trim(js_status) = 'P') begin
send info_box "This job is already in production."
set focus of btnClear to true
//Procedure_Return
end
End_Procedure


//AB-StoreEnd

End_Object // oPrintsub_Grid

Object oDbGrid1 is a dbGrid
Set Main_File to Printtrn.File_Number
Set Server to Printtrn_DD
Set Size to 70 395
Set Location to 70 6
Set Wrap_State to TRUE

Begin_Row
Entry_Item Printtrn.Expense_type
Entry_Item Printtrn.Description
Entry_Item Printtrn.Qty
Entry_Item Printtrn.Costunit
Entry_Item Printtrn.Total
End_Row

Set Form_Width item 0 to 120
Set Header_Label item 0 to "Expense type"
Set Column_Combo_State item 0 to True

Set Form_Width item 1 to 100
Set Header_Label item 1 to "Description"

Set Form_Width item 2 to 50
Set Header_Label item 2 to "Qty"

Set Form_Width item 3 to 50
Set Header_Label item 3 to "Costunit"

Set Form_Width item 4 to 50
Set Header_Label item 4 to "Total"


//AB-StoreStart
Procedure End_Construct_Object
Integer iOrdering
Forward Send End_Construct_Object
Get Ordering To iOrdering
If (Server(Self) <> (Main_DD(Self))) Begin
Set Ordering Of (Server(Self)) To iOrdering
End
End_Procedure


Procedure Item_Change integer iFromItem integer iToItem returns
integer
integer iRetVal
string colBefore colCurrent
if (iFromItem > 0) begin
get value of self item (iFromItem-1) to colBefore

// check item lines here
if (colBefore = "Materials: Stock") begin
get value of self item iFromItem to colCurrent
open inmaster
clear inmaster
move colCurrent to inmaster.Code
find eq inmaster by index.1
if (not(found)) begin
send info_box "This stock item does not exit"
set value of self iFromItem to ""
set focus to self iFromItem
Procedure_Return iFromItem
end
else begin
set value of self (iFromItem+2) to inmaster.Avg_cost
end
end


end

forward get msg_Item_Change iFromItem iToItem to iRetVal
Procedure_Return iRetVal
End_Procedure // Item_Change

//AB-StoreEnd

End_Object // oDbGrid1


//AB-StoreStart
Set Verify_Save_Msg to GET_No_Confirmation

Procedure ChangeFilter string sValue
set psFilter to sValue
send Rebuild_Constraints of Printtrn_DD
send Rebuild_Constraints of Printsub_DD
End_Procedure

Procedure shadow_me boolean bShadow string status
integer i
set enabled_state of btnSave to false
if (status = "C") begin
for i from 0 to 4
set column_shadow_state of oDbGrid1 i to true
loop
for i from 0 to 2
set column_shadow_state of oPrintsub_Grid i to true
loop
end
if (status = "P") begin
set enabled_state of btnSave to true
for i from 0 to 2
set column_shadow_state of oPrintsub_Grid i to true
loop
end
if (status = "*") begin
for i from 0 to 2
set column_shadow_state of oPrintsub_Grid i to false
loop
end
End_Procedure
//AB-StoreEnd

CD_End_Object // oPrintRecovery


//AB-StoreStart
property string psFilter ''
//AB-StoreEnd

//AB/ End_Object // prj