Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parent/child logical referencing

Status
Not open for further replies.

NickNick

Technical User
Apr 23, 2001
12
GB
Please can you help. I have a parent form that has a unique Refence number. The idea is to use this reference appended with another sequential number stored in the parent document.

"ActionID" is field on parent doc - editable number field
"Reference" is field on parent doc - computed text field
"Ac_ID" is field on open child doc - editable text field

The following formula runs when a Save & exit button is clicked -

Temp1 := @GetDocField ( $Ref; "ActionID" ) ;
Temp2 := @GetDocField ( $Ref; "Reference" ) ;
Temp3 := @TextToNumber(Temp1) + 1 ;
@If ( @IsNewDoc ; @Do ( @SetField ( "Ac_ID" ; ( Temp2 + "/" + Temp1 ) ) ;
@SetDocField ( $Ref ; "ActionID" ; @TextToNumber ( Temp3 ) ) ;
@Command ( [FileSave] ) ;
@Command ( [FileCloseWindow] ) ) ;
@Do ( @Command ( [FileSave] ) ;
@Command ( [FileCloseWindow] ) ) )

Can you suggest any reasons why this won't work, and what I need to do to make it work?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top