473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

pass form parameter to Sp to Run the the report

11
I have a parameter form to populate the report whose control source "Stored procedure", Form has 3 control and one click event as well as as Set on Report's Input parameter property is

Expand|Select|Wrap|Line Numbers
  1. @UID=Forms!RPM_Audit_Trail!CboUser,@SDate=Forms!RPM_Audit_Trail!TxtSdate,@EDate=Forms!RPM_Audit_Trail!txtEdate

And My Stored procedure is

Expand|Select|Wrap|Line Numbers
  1. CREATE PROCEDURE dbo.Sp_UserActivity
  2. @UID INT , @SDate Datetime , @EDate Datetime
  3. AS
  4.  
  5. SELECT dbo.AuditTrailT.AuditiD, dbo.UserT.FullName + ' [ ' + dbo.UserT.LoginName + '] - ' + dbo.DepartMentT.DepartMent AS UserDetails,
  6. dbo.AuditTrailT.EventDate, dbo.ATrailEventT.EventType, dbo.AuditTrailT.ObjectiD
  7.  
  8. FROM dbo.DepartMentT RIGHT OUTER JOIN
  9. dbo.UserT ON dbo.DepartMentT.DepartMentiD = dbo.UserT.DepartMent RIGHT OUTER JOIN
  10. dbo.AuditTrailT ON dbo.UserT.UseriD = dbo.AuditTrailT.UseriD LEFT OUTER JOIN
  11. dbo.ATrailEventT ON dbo.AuditTrailT.EventObject = dbo.ATrailEventT.EventID
  12.  
  13. WHERE UserT.Userid=@UID AND dbo.AuditTrailT.EventDate BETWEEN @Sdate AND @EDate
  14. GO

Here is the form's click event

Expand|Select|Wrap|Line Numbers
  1. Private Sub BtnPrint_Click()
  2. DoCmd.Close
  3. DoCmd.OutputTo acOutputReport, "rptaudittrail", "Snapshot Format", "D:\MyADPProject\App\Reports\rptaudittrail.snp", True
  4. End Sub
  5.  

Problem is when Click the click_event it prompts access default parameter form" enter parameter value". Would you please anyone suggest me , what's wrong with the above scenario or What's missing there . . .

(Application Based on A2003 ADP with Sql 2000 Server)
Apr 26 '10 #1
4 2225
Jim Doherty
897 Expert 512MB
@sknaina
If you are using the input parameter as stated to populate the form then the same value has to be inserted into the reports InputParameter property. Make sure both are present and it should work.

In an ADP data project file Both a Form AND a report have an InputParameter section just make sure the two mirror each other. What essentially happens here is that the report runs 'independant' to the form and seeks the input parameters which in your instance is being provided by the form input parameters
Apr 26 '10 #2
sknaina
11
@Jim Doherty
Thanks to reply, Yes I already use Same Input parameter for form as well as report(forget to mention) though form is unbound. AND Second thing , when run the report independently it prompts access default form . .
Apr 26 '10 #3
Jim Doherty
897 Expert 512MB
@sknaina
Look at your code closely... you are closing the form before the report is run. How can it pick up on the parameters on an open form if it is closed? just hide the form until the report has opened and then close the form when the report has formatted

Regards

Jim
Apr 27 '10 #4
sknaina
11
@Jim Doherty
Jim, now it works and once again thanks for great suggestion
Apr 27 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: deko | last post by:
I'd like to use a bit of code in the OnOpen event of a report: =rptOpen(Me.ReportName), (Me.Tag) --this doesn't work This does work: Private Sub Report_Open(Cancel As Integer)...
5
by: Don Seckler | last post by:
I have an update query that runs when a report closes. I have several reports that will need to run the update query with diferent criteria. I'd like to simply make the criteria change in the...
5
by: GB | last post by:
Hello: In my MS Access project I have two objects - my form and my report. I need to pass variable value from Command_click procedure of my form to Report_open procedure of my report. How can I...
0
by: Brenny | last post by:
Hi I'm developing a project and in the project, I used crystal report. Firstly my database isn't protected with password. After finishing project I determined a password for my database. Firstly...
1
by: Ray | last post by:
Dear all, How to pass parameter from vb.net to Crystal Report? I'm now using ReportDocument and CrystalReportViewer. However, I don't know how to pass a parameter to the report and print the...
4
by: Marcelo | last post by:
Any suggestion? Thanks Marcelo
2
by: Roger | last post by:
Anyone know how to pass a parameter to a query via a report in Access 2003?
5
by: cpnet | last post by:
I'm able to pass string parameters with no problems to a LocalReport being displayed by the ASP.NET ReportViewer control. However, my report also has a DateTime parameter. ...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
3
by: jtrapat1 | last post by:
Im using sql server 2005 and visual studio 2005. I just want to create some reports and deploy them to the local reportserver for an intranet application by using reporting services. I'd like to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.