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

A Simple Question About Record Selection

Status
Not open for further replies.

mzeezee

Programmer
Apr 16, 2011
5
PK
Hey Guys

Good Day!

I just need to ask a very simple question but stuck with it ..

I am using VB6 with crystal reports 8.5 ... I have created a report which lists product wise sales details .. defined 2 parameters, FROM PRODUCT and TO PRODUCT ... In VB form prompting via combobox with all products as well as a SELECT ALL option and then passing these to crystal report parameters ....

I just want to ask if user is selecting SELECT ALL then what value should I pass in report paramerts ??

A generous and immediate reply would highly be appreciated :)

Best Regards

ZEE
 
Hi,
Will ALL be an option for both parameters?
How is your selection made - a single field that can be in a range defined by the 2 parameters or 2 fields that should match the 2 passed parameters?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
OK let me explain it a further ...

The report is designed to display product wise sale records

In VB Form I am accepting a range FROM PRODUCT and TO PRODUCT thru comboboxes as follows:
cmbProdFrDesc
cmbProdToDesc

In Crystal Report I have defined two String parameters to accept above mentioned values

Now If user select some values then I pass as:

CrxReport.ParameterFields(1).AddCurrentValue (cmbProdFrCode)
CrxReport.ParameterFields(2).AddCurrentValue (cmbProdToCode)

But if user chooses SELECT ALL (which is the first selection in both combos) then what should i pass in report parameters? Note that production descriptions will be alpha numeric (like TUBE001 or TYRE546 or 155/70R12 etc)

CrxReport.ParameterFields(1).AddCurrentValue ("?????")
CrxReport.ParameterFields(2).AddCurrentValue ("?????")

Best Regards

ZEE
 
Hi,
I still need to know the selection formula that uses those parameters in order to fully understand what may be needed, but, just pass 'ALL' instead of the values from the ComboBox and test for it first in your selection formula.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi,
I missed noting that 'ALL' should be the value returned from the ComboBox when 'SELECT ALL' is chosen - you may be doing that already I imagine.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi ..

Oh mannn it was just sooo simple but as I said I was just stuck with it ... Thanx a million my dear friend you have just solved my issue :D ... I have passed "ALL" in both parameters and checked them in record selection and it is working perfect :))

By the way i am simply checking ListIndex of combobox as follows:

If cmbProdFrDesc.ListIndex = 0 Then
CrxReport.ParameterFields(1).AddCurrentValue ("ALL")
CrxReport.ParameterFields(2).AddCurrentValue ("ALL")
Else
CrxReport.ParameterFields(1).AddCurrentValue (cmbProdFrCode)
CrxReport.ParameterFields(2).AddCurrentValue (cmbProdToCode)
End If

Thank you once again my dear Turkbear :)

Best Regards

ZEE
 
and yes here is the record selection now:

If {?ProdFr} = "ALL" Then
{QryOrder.OdetStatus} <> "S"
else
{QryOrder.OdetStatus} <> "S" and
{QryOrder.ProdDesc} in {?ProdFr} to {?ProdTo}

 
Glad to have helped..Sometimes it is the simple things that drive us nuts!!



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top