Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: David Mustakim
  Where is David Mustakim?
 David Mustakim
 To: Eddie Ruiz
  Where is Eddie Ruiz?
 United States
 Eddie Ruiz
Subject: RE: option group / check boxes question
Thread ID: 395980 Message ID: 395983 # Views: 32 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Wednesday, January 22, 2014 5:19:11 AM         

> Hi, im currently using the following data to export some information from dbfs 1, 2 and 3, the code located when a user clicks a button in a form after the user inputs their desire date range.
> LOCAL ldStartdate, ldEnddate, ldcategory
> ldStartdate = thisform.startdatetextbox.value
> ldEnddate = thisform.enddatetextbox.value
> * verify values
> If NOT vartype(ldStartdate)+Vartype(ldEnddate)=="DD"
> Messagebox("wrong date entry")
> Return
> Endif
> If ldEnddate> Messagebox("wrong date range")
> Return
> Select 1.ntype, 1.ndate, 1.nnum, 1.cusnum, 2.cusname, 3.price, 3.ordqty, 3.shipqty, 3.Descript, 3.category ;
> from 1 inner Join 3 On 1.nnum = 3.nnum ;
> inner join 2 ON 2.cusnum = 1.cusnum ;
> where 1.ntype = "C" and;
> 1.ndate;
> between m.ldstartdate And m.ldenddate ;
> into cursor crsToExcel ;
> nofilter
> COPY TO (PUTFILE("Enter Orders Excel Sheet Name","orders.xls","XLS")) TYPE XLS
> ***************************
> What I would like to accomplish is be able to add option group or check boxes that a user could select to export their desire data. In table 3 there's a field called categories, theres like 5 categories stored 1=as 2=to 3=fl 4=ws and 5=pr also on table 2 theres a field called repsales theres like 5 different repsales stored 1=io 2=da 3=gr 4=lu and 5=yz. I want to be able to have the option to the user to export by selecting the desired options that i mentioned. For example user 1 can select to export from table 1 all fields with the "As"category with repsales "yz" and be able to export only this data.
> How can i accomplish this? if the option group on the form works what code needs to be added to the option group and to my code above to make it happen?
> Thanks for your help
> I don't know what would be the best way to do this, I want to have the user choose

The "value" property of an optiongroup will contain a number corresponding to the order number of the selected button, thus if for instance you select "gr" button of the repsales optiongroup then the "value" property of its optiongroup shall contain numeric 3. So, assuming table 1 has a field for Category number and another field for RepSales number then you simply extend the sql-select query with another "and...and..." clause, eg.: "... AND 1.fieldRepno=nRepNum AND 1.fieldCatno=nCatNum ...". Of course the two new vars nRetNum and nCatNum should first be assigned values before executing the query, eg:
nRetNum = thisform.OptGrpRepsales.value
nCatNum = thisform.OptGrpCategory.value
You should therefore ensure that the OptGroup's buttons are laid out properly in accordance to the order numbering used in the corresponding fields in all tables




option group / check boxes question Posted by Eddie Ruiz @ 1/22/2014 3:31:30 AM
RE: option group / check boxes question Posted by Ali Koumaiha @ 1/22/2014 4:52:09 AM
RE: option group / check boxes question Posted by Ali Koumaiha @ 1/22/2014 4:54:49 AM
RE: option group / check boxes question Posted by David Mustakim @ 1/22/2014 5:19:11 AM