We help IT Professionals succeed at work.

passing variable to  crystal report 8.5  from vb6.0

the problem  i am  facing is when  i am  using code written  below:

CrystalReport1.ParameterFields(0) = "zzzzz;" & IDComp & ";TRUE"

i  can't pass parameter information into  report and it come up with  the blank  prompt but when i use

CrystalReport1.ParameterFields(0) = "zzzzz;" & IDComp

it passed the information into  report but show the prompt and ask  to  press OK or Cancel which i  don't want i  just  want to  pass parameter information string into report

i  tried everything so  far no solution please help  me thanks

i  am  suing crystal report 8.5  and vb6.0 thanks
Comment
Watch Question

Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Have you tried

CrystalReport1.ParameterFields(0) = "zzzzz;" & IDComp & ";FALSE"

Does it show the correct value for the parameter when it works?

mlmcc

Author

Commented:
yes it is showing me the values in but i don't want crystal report prompt comming on screen
thanks for your help  but i  found out the answer my  self  actuall error is written  down below:

CrystalReport1.DiscardSavedData = True

and answer for that  is

CrystalReport1.DiscardSavedData = false

and passing variable into crystal report stated working thanks

Author

Commented:
no
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Where was that line in the code?  If it is after the lines setting the parameters when set true it ignores the set parameters.

You could try moving it to the first line after opening the report.

mlmcc

Author

Commented:
not i  am  not doing anything to  it because i  got it going  so  i  would like to  close the question