Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2005

Tip: Looking for answers? Try searching our database.

Report from Form w/Criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scott B - 11 Jul 2005 04:40 GMT
Greetings,

I have a form that derives it's data from a query with criteria [Type
Arrival Date].  I have a report that is opened with a command button from
the form with the following code on the On Click event:

Private Sub cmdPrintArrivals_Click()
On Error GoTo Err_cmdPrintArrivals_Click

   Dim stDocName As String

   stDoc = "rptGuestArrivals"
   stCriteria = "ID = " & Me.ID
   DoCmd.OpenReport stDoc, acNormal, , stCriteria

Exit_cmdPrintArrivals_Click:
   Exit Sub

Err_cmdPrintArrivals_Click:
   MsgBox Err.Description
   Resume Exit_cmdPrintArrivals_Click

End Sub

Can anyone tell me how I make it so the report takes the criteria from the
form without the criteria pop-up appearing when the report is opened from
the command button?  The form and the report both use the same query.

Thanks,
Scott B
Duane Hookom - 11 Jul 2005 05:13 GMT
Don't use parameter prompt queries. Replace them with references to values
of controls on forms. Martin Green has some good tips on how to do this at
http://www.fontstuff.com/access/index.htm.

Signature

Duane Hookom
MS Access MVP

> Greetings,
>
[quoted text clipped - 26 lines]
> Thanks,
> Scott B
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.