?
Solved

Datareport - Easy question

Posted on 2006-04-16
12
Medium Priority
?
184 Views
Last Modified: 2010-05-01

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.
0
Comment
Question by:nomeoj
  • 6
  • 6
12 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 1500 total points
ID: 16463904
0
 

Author Comment

by:nomeoj
ID: 16464180
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 16464184
Which error?

Do you have a data environment named DataEnvironment1?

Do you have a command in this data environment named Command1?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:nomeoj
ID: 16469744
Yes. Thats right. But am not able to get the report.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 16469769
again, which error ?
0
 

Author Comment

by:nomeoj
ID: 16470444
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 16470480
sure, all you need to do is to replace
.Command1 CDate(Text1.Text)

with something like:
.Command1 CDate(datetimepicker1.value)
0
 

Author Comment

by:nomeoj
ID: 16470607
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 16470614
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
 

Author Comment

by:nomeoj
ID: 16471433
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 16472486
>>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
 

Author Comment

by:nomeoj
ID: 16472988
Thanks. Got it.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question