I am trying to run a Code attached to a different form.
var vTmp as Int
vTmp = @SelectTreeItem(@Application + "!Forms!Search/Update!Physical!Physical")
FormRunProgram ("Physical", "Select_Dates" , Program_Event_LE_Enter)
The code attached to the the "Select_Dates" command button element is as follows:
var vResult as String
var vString as String
var vStr as string
vResult = @FormAsDialog ("DialogDates")
WriteLn (vResult)
vResult = @Replace (vResult, "=", ";")
vResult = @AccessStringArray (vResult, 2) + ";" +
@AccessStringArray (vResult, 4)
WriteLn (vResult)
//vResult = "2008/02/17;2008/02/28"
vString = "{Date1 >= " + @chr (34) + @AccessStringArray(vResult, 1) + @Chr (34) + " and " + "Date1 <= " + @chr (34) + @AccessStringArray (vResult, 2) + @Chr (34) + "}"
//WriteLn (vString)
// {Date1 >= "2008/02/17" and Date1 <= "2008/02/28"}
His1 = vString
vStr = @SpecCommand (2, 1, "")
What I expecting was to open the DialogDates form and picks up the dates and then Run the retrieve spec. When I press the command button "Select_Dates" in the "physical" form, everything works fine as it is supposed to but it is not activating the code with FormRunProgram ( ) from other form. What am I doing wrong?
Moreover the Programing Guide states that the form name can be specified with the Mode Specifier. Is it using if @Mode () = 2 then command or by some other method?