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?
 
Éric MoreauSenior .Net ConsultantCommented:
0
 
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
0
 
É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?
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
nomeojAuthor Commented:
Yes. Thats right. But am not able to get the report.
0
 
Éric MoreauSenior .Net ConsultantCommented:
again, which error ?
0
 
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?
0
 
Éric MoreauSenior .Net ConsultantCommented:
sure, all you need to do is to replace
.Command1 CDate(Text1.Text)

with something like:
.Command1 CDate(datetimepicker1.value)
0
 
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.
0
 
É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)
0
 
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
0
 
É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
0
 
nomeojAuthor Commented:
Thanks. Got it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.