Click to See Complete Forum and Search --> : Passing parameters in VB
hiran3727
Feb 27th, 2006, 04:28 AM
Hi,
I want to pass parameter from form to datareport.
i have written the query as follows...
select --------------- from ---------------- where trans_code=&trans
in the dataenvironment1. command.
i want to open this report by clicking on the button in the form.
pl help me.
Regards
CHAMPGARY
Feb 27th, 2006, 05:01 AM
DataEnv1.Connection1.Open
DataEnv1.Command1 (Text1.Text) ' pass parameter value here
DataReport1.Show
Hack
Feb 27th, 2006, 05:39 AM
Moved to reporting section
hiran3727
Feb 28th, 2006, 03:43 AM
Hi,
Thanks for the response.
I have tried passing the parameter as above. It is working fine with the parameter having integer as datatype. i want to pass text as parameter. When i am trying to pass, it is giving the error.
In the parameter tab in dataenvironment.. what datatype to be selected when it is a text parameter.
adstr,adlongstr etc are there. i have tried with all.. but not able to pass it.
regards
Hiran
hiran3727
Mar 3rd, 2006, 04:06 AM
hi,
i am held up with this problem.
i have two parameters one is of interger type and one is of string type.
i am able to execute with the integer type parameter but not able to execute the report with the string data type.
in the dataenvironment, i have mentioned like this..
where a.staff_Code=? and a.salmonthyear=?
in the parameter form, i have one text box to pass staff code and combo to pass the salmonthyear which is string(varchar). i am getting error.. in the parameters tab in data environment, for salmonthyear i have define a datatype as advar and host datatype as string...
pl help me out in this issue.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.