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 / November 2005

Tip: Looking for answers? Try searching our database.

Error Printing report for current record

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Emma - 21 Nov 2005 23:55 GMT
Hi All,

I am trying to print a report for the current record only.

This is the code that I am using in the OnClick event of a command button in
a input form:

DoCmd.OpenReport "Rpt_Rental_Detail_Billing_Sheet", , , "Rental_ID = '" &
Me!Rental_ID & "'"

I am getting a data type mismatch here.  The Rental ID is an autonumber.  Am
I getting the error because DoCmd criteria requires a string?  If so, how do
I accomplish what I want to do?
Douglas J. Steele - 22 Nov 2005 00:07 GMT
Autonumbers are numbers, therefore you don't need to put quotes around their
values:

DoCmd.OpenReport "Rpt_Rental_Detail_Billing_Sheet", , , "Rental_ID = " &
Me!Rental_ID

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Hi All,
>
[quoted text clipped - 12 lines]
> do
> I accomplish what I want to do?
Emma - 22 Nov 2005 16:57 GMT
Still not opening current record.  Could it be because I am passing
parameters via OpenArgs?  Though I am not passing the Rental_ID.

> Autonumbers are numbers, therefore you don't need to put quotes around their
> values:
[quoted text clipped - 18 lines]
> > do
> > I accomplish what I want to do?
Douglas J Steele - 22 Nov 2005 17:23 GMT
You sure Me!Rental_ID is providing the correct value?

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Still not opening current record.  Could it be because I am passing
> parameters via OpenArgs?  Though I am not passing the Rental_ID.
[quoted text clipped - 21 lines]
> > > do
> > > I accomplish what I want to do?
Emma - 22 Nov 2005 18:00 GMT
It looks like the record is not being created until I leave the form.  How do
I get it to update when I click on the command button?

> You sure Me!Rental_ID is providing the correct value?
>
[quoted text clipped - 28 lines]
> > > > do
> > > > I accomplish what I want to do?
Emma - 22 Nov 2005 22:28 GMT
I figured it out.  What is happening is that the report is being populated by
another query.  Because of additional fields that need to be displayed that
are not in the Qry_Rental_Detail.  I think I've got it from here if I can get
the "subscript out of range" error figured out.

> You sure Me!Rental_ID is providing the correct value?
>
[quoted text clipped - 28 lines]
> > > > do
> > > > I accomplish what I want to do?
 
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.