Results 1 to 5 of 5

Thread: Passing parameters in VB

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    62

    Passing parameters in VB

    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

  2. #2
    Hyperactive Member CHAMPGARY's Avatar
    Join Date
    Jul 2002
    Posts
    386

    Re: Passing parameters in VB

    VB Code:
    1. DataEnv1.Connection1.Open
    2. DataEnv1.Command1 (Text1.Text) ' pass parameter value here
    3. DataReport1.Show
    Regards,
    CHAMPGARY

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Passing parameters in VB

    Moved to reporting section

  4. #4

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    62

    Re: Passing parameters in VB

    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

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    62

    Re: Passing parameters in VB

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width