Datareport - Easy question


Hi Experts

I need to generate a report using datareport.

I have a form with 2 date picker's, 2 combo box, inwhich 1st combo box is for the user name and the 2nd combo box is the report name.

The report I need to generate is..,
Upon selecting the date, and selecting the user name in combo box 1 and selecting the report name in combo box2, if I click on a command button, appropriate report should generate.,

In combo box 2, I have nearly 10 reports name.

Need help.
nomeojAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nomeojAuthor Commented:
In that link, am getting an error under 7th option.

Private Sub Command1_Click()
  Load DataEnvironment1
  With DataEnvironment1
    If .rsCommand1.State <> 0 Then .rsCommand1.Close
    .Command1 CDate(Text1.Text)
  End With
  DataReport1.Refresh
  If DataReport1.Visible = False Then DataReport1.Show
End Sub

Error is  .rsCommand1.State

need help
Éric MoreauSenior .Net ConsultantCommented:
Which error?

Do you have a data environment named DataEnvironment1?

Do you have a command in this data environment named Command1?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

nomeojAuthor Commented:
Yes. Thats right. But am not able to get the report.
Éric MoreauSenior .Net ConsultantCommented:
again, which error ?
nomeojAuthor Commented:
Am sorry. Now the report works. However its useful only in Text Box. Is it possible to choose using Date picker, thats from and to date?
Éric MoreauSenior .Net ConsultantCommented:
sure, all you need to do is to replace
.Command1 CDate(Text1.Text)

with something like:
.Command1 CDate(datetimepicker1.value)
nomeojAuthor Commented:
This is great. Actually what am looking is., I have 2 date picker in which first one is to choose the " FROM DATE" and the other one is for " TO DATE". Simultaneously, once I choose the dates, I will have another combo box to choose the "USER NAME". I should get a report accordingly. This is my need. Can u pls help me.
Éric MoreauSenior .Net ConsultantCommented:
If you can get it for 1 parameter, you should be able to do it for 3!

You need a Command object that as 3 parameters and provide these 3 params to the command:
.Command1 CDate(datetimepicker1.value, datetimepicker2.value, cbouser.text)
nomeojAuthor Commented:
Am very new to this reporting tool. Can u pls guide me thru to do for 3 parameter. I have no clue. Pls help
Éric MoreauSenior .Net ConsultantCommented:
>>Am very new to this reporting tool.

It has nothing to do with the report. Parameters are for the Command object. Your CommandText property must have 3 ? (because you have 3 parameters), your parameters tab must alss specify the 3 parameters. Finally, when you call the Command, you need to pass 3 values:
.Command1 datetimepicker1.value, datetimepicker2.value, cbouser.text
nomeojAuthor Commented:
Thanks. Got it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.