CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: VB

  1. #1
    Join Date
    Feb 2000
    Location
    andhra pradesh,India
    Posts
    1

    VB

    hai,
    This is regarding datareports ,iam not abel to add second command to my control on the datareport form.since datareport properties r set to dataenvironment1 and command1.
    how should i add command2 to the datamember of textbox or any control.

    pls help me thanks in advance.


    pmreddy

  2. #2
    Join Date
    Jan 2000
    Posts
    21

    Re: VB

    By DataReport do you mean DBGrid? If so, put one
    DBGrid on top of another, i.e. DBGrid2 on top of
    DBGrid1, and set DBGrid2's Visible Property to "False". Attach DbGrid1 and Command1 to the Data1 Control, in Command1's Click Event insert
    DBGrid1.Visible ="True". Then add another DataControl,Data2 and connect it to Command2 and DBGrid2. Next, when clicking on Command2 set DBGrid1's visible property to "True" and DBGrid1's Visible Property to "False".


  3. #3
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: VB

    Although the data report designer is pretty nice - it's also pretty simplistic. I don't know of a way to get multiple command objects bound to the same report. You can only have one command that the report is bound to, becuase the report's command dictates the child-controls' command's fields. Then when you are setting up your text boxes or labels on the report, you have to choose from the fields from the command chosen for the report.

    I hope this makes sense - it seems a little confusing to me even. Basically, the answer to your question is: No, you can't have more than one command on any one report. sorry.

    If someone else has figured this out - let me know, because I've tried about everything I can think of.

    Maybe in VB7 MS will improve this feature. We can hope.

    John

    John Pirkey
    MCSD
    www.ShallowWaterSystems.com
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

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

Featured