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!

running a form without user intervention!

Status
Not open for further replies.

Myqns

Programmer
Jul 28, 2004
23
GB
I have a form that has couple of command buttons. These buttons lead to two other forms. In these two forms there are about 10 -12 checkboxes (each represent a report) and few buttons. Select the required reports by selecting the checkboxes and click on the button, it prints all the selected reports. How do I print all the reports in both the forms without selecting the check boxes and clicking the button from another program? (ie.) without user intervention.

Thanks
 
You need to automate your form. I do this myself sometimes with some of my apps made to interface with a human, but sometimes needs to be run in 'batch mode'.

I just write a prg that launches the app/form and issue commands to the _screen.activeform e.g.

Code:
do form MyForm
_screen.activeform.visible=.f.
_screen.activeform.Check1.value=1
_screen.activeform.RunRptButton.click
_screen.activeform.release
 
I threw in the .visible=.f. because I thought you might not want to show what was going on, but it causes activeform to fail.

This works better.

Brian

Code:
do form MyForm noshow name MyForm
MyForm.Check1.value=1
MyForm.RunRptButton.click
MyForm.release
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top