Click to See Complete Forum and Search --> : VB
madhu_reddy
February 7th, 2000, 11:14 PM
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
johnpc1
February 8th, 2000, 07:34 AM
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".
Johnny101
February 8th, 2000, 10:28 AM
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
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.