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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need advice on an OK button. 2

Status
Not open for further replies.

Russ1005

Programmer
Dec 13, 2004
96
US
Most of the visual development experience I have is Access. I have a newbie type vfp question. I've inherited a project that has a radio button group of report names (the user wants this format). I need to create an OK button to check which radio button (report) was selected and print the associated report. I have no clue at this point how to accomplish this.

Any advice on a direction to go in would be much appreciated.

Thanks,
-Russ
 
Create a form,
Place your radiobutton group on the form (I assume you mean this has already been created as a class).. call it "rdoReport"
create a form property ( Form menu -> Add property ) called "nReportNum"
Put "THISFORM.nReportNum" in rdoReport.ControlSource

In your OK button's .Click event, put code resembling this:
Code:
DO CASE
  CASE THISFORM.nReportNum=1
    * do the first report
  CASE THISFORM.nReportNum=2
    * do the second report
  * etc
ENDCASE
THISFORM.Release

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Exactly the advice I needed! Thanks for your quick response.
 
Hi Russ,

In the Form Designer drop a command button onto your form. Change its caption to OK. Add Click event code to determine which button was selected and run the appropriate report. Something like:

DO CASE
CASE THISFORM.MyOptionGroup.VALUE = 1
REPORT FORM Report1......
CASE THISFORM.MyOptionGroup.VALUE = 2
REPORT FORM Report2......
.
.
ENDCASE


Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top