Normal Topic FormRunProgram (Read 825 times)
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
FormRunProgram
Sep 9th, 2010 at 10:13pm
Print Post Print Post  
Parent form Purch.  Subform POLines.  Command button BOtiks on Subform.  the code in the command button is "Writeln(sRpt)" which prints a static string variable.  

when pressing the command button Save on the parent form Purch, I have  
a line of code ... FormRunProgram("POLines", "BOtiks", PROGRAM_EVENT_LE_ENTER). ... I've also tried it this way, also with no joy  ... FormRunProgram("Purch!POLines", "BOtiks", PROGRAM_EVENT_LE_ENTER)

When the subform button BOtiks is pressed directly, it works fine.  But when the Save button is pressed on the parent form, the above FormRunProgram code doesn't work.

What am I doing wrong?
« Last Edit: Sep 10th, 2010 at 1:15pm by lksseven »  

Larry
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: FormRunProgram
Reply #1 - Sep 10th, 2010 at 11:18pm
Print Post Print Post  
As far as I know, the form having the original program should be open in order for this to work. How about if you open the form first and then fire this code? Just wondering!
  
Back to top
 
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: FormRunProgram
Reply #2 - Sep 12th, 2010 at 12:38am
Print Post Print Post  
Hi Bharat,

both forms (parent form Purch and subform POLines) are open.  The Writeln program is in a command button in POLines (subform);  I wish to run this program (Writeln(sRpt) ) when I press the Save command button in the parent form Purch (while the POLines subform is visible and open in the parent form), so that the PO will be saved and then a slate window will open with a list of the backorder tickets for whom incoming product has just been received.

I'm stymied.
  

Larry
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: FormRunProgram
Reply #3 - Sep 12th, 2010 at 1:43pm
Print Post Print Post  
I seem to remember running into some trouble trying to get FormRunProgram to work on a command button, in the past. It was a few years ago, so I don't remember all the details. Have you tested running the code from another event, like the On Element Enter event of a text box?

Otherwise, you could just collect the data in the subform, from within the parent form via @FormFieldValue. Then put it in the slate from there.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: FormRunProgram
Reply #4 - Sep 13th, 2010 at 2:10am
Print Post Print Post  
When you say that it doesn't work, does that mean it does not run at all or that it does something incorrect?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: FormRunProgram
Reply #5 - Sep 13th, 2010 at 2:36am
Print Post Print Post  
If the LE is a push button or a radio button you have to put the programming in one of the other events (probably element exit) and adjust the FormRunProgram event argument accordingly.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: FormRunProgram
Reply #6 - Sep 14th, 2010 at 3:31pm
Print Post Print Post  
Hammer,
     FormRunProgram - in the parent Save button routine - doesn't run at all.

Cow,

    It's a push button.  I'll change to another event and try it that way.  Thanks.
  

Larry
Back to top
IP Logged