DoCmd - Print Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I make the report to print. I need this to be
printed by selecting the date. I have the code but don't
know why its not working. Can somebody point out where is
the mistake.

Dim stDocName As String
Dim strWhere As String
stDocName = "Recap report"
strWhere = "[deposit_date]=#" & Me.deposit_date & "#"
DoCmd.OpenReport stDocName, acViewNormal

When I click, it shows the msg box saying Now Printing on
Printer, then an input Box asking for the date to enter
the date. But nothing gets printed.
Please help. Thanks in advance
 
If you add your strWhere to the arguments for OpenReport, as follows,

DoCmd.OpenReport "stDocName", acViewNormal, , strWhere

Do you get your report printed with the correct dates?
 
No, it doesn't print. Infact If I use acPreview instead of
acViewNormal, it shows the correct Report date and then if
I print it prints. Why does it not happen with acPreview??
(direct print)

Thanks for replying immediately.
-----Original Message-----
If you add your strWhere to the arguments for OpenReport, as follows,

DoCmd.OpenReport "stDocName", acViewNormal, , strWhere

Do you get your report printed with the correct dates?




--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


How can I make the report to print. I need this to be
printed by selecting the date. I have the code but don't
know why its not working. Can somebody point out where is
the mistake.

Dim stDocName As String
Dim strWhere As String
stDocName = "Recap report"
strWhere = "[deposit_date]=#" & Me.deposit_date & "#"
DoCmd.OpenReport stDocName, acViewNormal

When I click, it shows the msg box saying Now Printing on
Printer, then an input Box asking for the date to enter
the date. But nothing gets printed.
Please help. Thanks in advance


.
 
Try leaving out the acViewNormal (but do leave in the comma as a
placeholder).

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


No, it doesn't print. Infact If I use acPreview instead of
acViewNormal, it shows the correct Report date and then if
I print it prints. Why does it not happen with acPreview??
(direct print)

Thanks for replying immediately.
-----Original Message-----
If you add your strWhere to the arguments for OpenReport, as follows,

DoCmd.OpenReport "stDocName", acViewNormal, , strWhere

Do you get your report printed with the correct dates?




--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


How can I make the report to print. I need this to be
printed by selecting the date. I have the code but don't
know why its not working. Can somebody point out where is
the mistake.

Dim stDocName As String
Dim strWhere As String
stDocName = "Recap report"
strWhere = "[deposit_date]=#" & Me.deposit_date & "#"
DoCmd.OpenReport stDocName, acViewNormal

When I click, it shows the msg box saying Now Printing on
Printer, then an input Box asking for the date to enter
the date. But nothing gets printed.
Please help. Thanks in advance


.
 
I put in this code
DoCmd.OpenReport stDocName, , , strWhere
Sorry, it didn't print. The code looks fine but just can't
figure out why its not printing this way.
-----Original Message-----
Try leaving out the acViewNormal (but do leave in the comma as a
placeholder).

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


No, it doesn't print. Infact If I use acPreview instead of
acViewNormal, it shows the correct Report date and then if
I print it prints. Why does it not happen with acPreview??
(direct print)

Thanks for replying immediately.
-----Original Message-----
If you add your strWhere to the arguments for
OpenReport,
as follows,
DoCmd.OpenReport "stDocName", acViewNormal, , strWhere

Do you get your report printed with the correct dates?




--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


How can I make the report to print. I need this to be
printed by selecting the date. I have the code but don't
know why its not working. Can somebody point out
where
is
the mistake.

Dim stDocName As String
Dim strWhere As String
stDocName = "Recap report"
strWhere = "[deposit_date]=#" & Me.deposit_date & "#"
DoCmd.OpenReport stDocName, acViewNormal

When I click, it shows the msg box saying Now
Printing
on
Printer, then an input Box asking for the date to enter
the date. But nothing gets printed.
Please help. Thanks in advance


.


.
 
Let me re-check that I understand the problem as you have described it -
The following code will open your report in Preview Mode and display your
data correctly:

DoCmd.OpenReport stDocName, acViewPreview, , strWhere

But, when you attempt to use:

DoCmd.OpenReport stDocName, acViewNormal, , strWhere

or

DoCmd.OpenReport stDocName, , , strWhere

Your report does not get sent directly to the printer.

Is my understanding correct?

Do you receive any error messages? If so, please post them.

Is your version of Office/Access up to date on all Service Packs/Releases?

Open the Windows Control Panel - do you have a Default Printer selected?


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


I put in this code
DoCmd.OpenReport stDocName, , , strWhere
Sorry, it didn't print. The code looks fine but just can't
figure out why its not printing this way.
-----Original Message-----
Try leaving out the acViewNormal (but do leave in the comma as a
placeholder).

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


No, it doesn't print. Infact If I use acPreview instead of
acViewNormal, it shows the correct Report date and then if
I print it prints. Why does it not happen with acPreview??
(direct print)

Thanks for replying immediately.
-----Original Message-----
If you add your strWhere to the arguments for OpenReport,
as follows,

DoCmd.OpenReport "stDocName", acViewNormal, ,
strWhere

Do you get your report printed with the correct dates?




--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


How can I make the report to print. I need this to be
printed by selecting the date. I have the code but don't
know why its not working. Can somebody point out where
is
the mistake.

Dim stDocName As String
Dim strWhere As String
stDocName = "Recap report"
strWhere = "[deposit_date]=#" & Me.deposit_date
& "#"
DoCmd.OpenReport stDocName, acViewNormal

When I click, it shows the msg box saying Now Printing
on
Printer, then an input Box asking for the date to enter
the date. But nothing gets printed.
Please help. Thanks in advance


.


.
 
NOt exactly what you want but will do the trick:

______________________________

DoCmd.OpenReport "Operations - Folder - IPS Process
Control Sheet", acViewPreview, , "[IPSID] = " & Forms!
frmdatainput!subIPS.Form!IPSID ', acHidden

Dim Msg, Style, Title, Response

Msg = "Print File Folder Page?" ' Define message.
Style = vbYesNo + vbCritical +
vbDefaultButton2 ' Define buttons.
Title = "Print?" ' Define title.

Response = MsgBox(Msg, Style, Title)

If Response = vbYes Then DoCmd.PrintOut acPages, 1, 1
_______________________---
My code only prints the first page you'll need to modify
it --> acPages, 1, 1
-----Original Message-----
Let me re-check that I understand the problem as you have described it -
The following code will open your report in Preview Mode and display your
data correctly:

DoCmd.OpenReport stDocName, acViewPreview, , strWhere

But, when you attempt to use:

DoCmd.OpenReport stDocName, acViewNormal, , strWhere

or

DoCmd.OpenReport stDocName, , , strWhere

Your report does not get sent directly to the printer.

Is my understanding correct?

Do you receive any error messages? If so, please post them.

Is your version of Office/Access up to date on all Service Packs/Releases?

Open the Windows Control Panel - do you have a Default Printer selected?


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


I put in this code
DoCmd.OpenReport stDocName, , , strWhere
Sorry, it didn't print. The code looks fine but just can't
figure out why its not printing this way.
-----Original Message-----
Try leaving out the acViewNormal (but do leave in the comma as a
placeholder).

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


No, it doesn't print. Infact If I use acPreview
instead
of
acViewNormal, it shows the correct Report date and
then
if
I print it prints. Why does it not happen with acPreview??
(direct print)

Thanks for replying immediately.
-----Original Message-----
If you add your strWhere to the arguments for OpenReport,
as follows,

DoCmd.OpenReport "stDocName", acViewNormal, ,
strWhere

Do you get your report printed with the correct dates?




--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


How can I make the report to print. I need this to be
printed by selecting the date. I have the code
but
don't
know why its not working. Can somebody point out where
is
the mistake.

Dim stDocName As String
Dim strWhere As String
stDocName = "Recap report"
strWhere = "[deposit_date]=#" & Me.deposit_date
& "#"
DoCmd.OpenReport stDocName, acViewNormal

When I click, it shows the msg box saying Now Printing
on
Printer, then an input Box asking for the date to enter
the date. But nothing gets printed.
Please help. Thanks in advance


.



.


.
 
It shows the msg Box saying " Now Printing 'Recap Report'
to the 'Printer name' on 'IP address'", which is my
default printer, then it opens up the dialog box to enter
the date for the user to enter the date for which to print
report. After I enter the date and click Ok, both the
boxes disappear and nothing is printed. The connection to
the printer is fine, but its a mystery to me.
-----Original Message-----
Let me re-check that I understand the problem as you have described it -
The following code will open your report in Preview Mode and display your
data correctly:

DoCmd.OpenReport stDocName, acViewPreview, , strWhere

But, when you attempt to use:

DoCmd.OpenReport stDocName, acViewNormal, , strWhere

or

DoCmd.OpenReport stDocName, , , strWhere

Your report does not get sent directly to the printer.

Is my understanding correct?

Do you receive any error messages? If so, please post them.

Is your version of Office/Access up to date on all Service Packs/Releases?

Open the Windows Control Panel - do you have a Default Printer selected?


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


I put in this code
DoCmd.OpenReport stDocName, , , strWhere
Sorry, it didn't print. The code looks fine but just can't
figure out why its not printing this way.
-----Original Message-----
Try leaving out the acViewNormal (but do leave in the comma as a
placeholder).

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


No, it doesn't print. Infact If I use acPreview
instead
of
acViewNormal, it shows the correct Report date and
then
if
I print it prints. Why does it not happen with acPreview??
(direct print)

Thanks for replying immediately.
-----Original Message-----
If you add your strWhere to the arguments for OpenReport,
as follows,

DoCmd.OpenReport "stDocName", acViewNormal, ,
strWhere

Do you get your report printed with the correct dates?




--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


How can I make the report to print. I need this to be
printed by selecting the date. I have the code but don't
know why its not working. Can somebody point out where
is
the mistake.

Dim stDocName As String
Dim strWhere As String
stDocName = "Recap report"
strWhere = "[deposit_date]=#" & Me.deposit_date
& "#"
DoCmd.OpenReport stDocName, acViewNormal

When I click, it shows the msg box saying Now Printing
on
Printer, then an input Box asking for the date to enter
the date. But nothing gets printed.
Please help. Thanks in advance


.



.


.
 
I'm a beginner and unable to understand the code. I'm
sorry could you please explain as to how I should use this
code.

Thanks for the code.
-----Original Message-----
NOt exactly what you want but will do the trick:

______________________________

DoCmd.OpenReport "Operations - Folder - IPS Process
Control Sheet", acViewPreview, , "[IPSID] = " & Forms!
frmdatainput!subIPS.Form!IPSID ', acHidden

Dim Msg, Style, Title, Response

Msg = "Print File Folder Page?" ' Define message.
Style = vbYesNo + vbCritical +
vbDefaultButton2 ' Define buttons.
Title = "Print?" ' Define title.

Response = MsgBox(Msg, Style, Title)

If Response = vbYes Then DoCmd.PrintOut acPages, 1, 1
_______________________---
My code only prints the first page you'll need to modify
it --> acPages, 1, 1
-----Original Message-----
Let me re-check that I understand the problem as you have described it -
The following code will open your report in Preview Mode and display your
data correctly:

DoCmd.OpenReport stDocName, acViewPreview, , strWhere

But, when you attempt to use:

DoCmd.OpenReport stDocName, acViewNormal, , strWhere

or

DoCmd.OpenReport stDocName, , , strWhere

Your report does not get sent directly to the printer.

Is my understanding correct?

Do you receive any error messages? If so, please post them.

Is your version of Office/Access up to date on all Service Packs/Releases?

Open the Windows Control Panel - do you have a Default Printer selected?


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


I put in this code
DoCmd.OpenReport stDocName, , , strWhere
Sorry, it didn't print. The code looks fine but just can't
figure out why its not printing this way.
-----Original Message-----
Try leaving out the acViewNormal (but do leave in the
comma as a
placeholder).

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


No, it doesn't print. Infact If I use acPreview instead
of
acViewNormal, it shows the correct Report date and then
if
I print it prints. Why does it not happen with
acPreview??
(direct print)

Thanks for replying immediately.
-----Original Message-----
If you add your strWhere to the arguments for
OpenReport,
as follows,

DoCmd.OpenReport "stDocName", acViewNormal, ,
strWhere

Do you get your report printed with the correct dates?




--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


How can I make the report to print. I need this to be
printed by selecting the date. I have the code but
don't
know why its not working. Can somebody point out
where
is
the mistake.

Dim stDocName As String
Dim strWhere As String
stDocName = "Recap report"
strWhere = "[deposit_date]=#" & Me.deposit_date
& "#"
DoCmd.OpenReport stDocName, acViewNormal

When I click, it shows the msg box saying Now
Printing
on
Printer, then an input Box asking for the date to
enter
the date. But nothing gets printed.
Please help. Thanks in advance


.



.


.
.
 
If you are using a "Where" clause (strWhere) in your OpenReport code, you
should not have to respond to a prompt in a dialog box to enter the date.
So, let's check the following:

1. Is the RecordSource of your Report a query with a parameter? If so,
remove the parameter from the query.

2. In the design of your Report, make sure that the RecordSource contains a
field named: deposit_date


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


It shows the msg Box saying " Now Printing 'Recap Report'
to the 'Printer name' on 'IP address'", which is my
default printer, then it opens up the dialog box to enter
the date for the user to enter the date for which to print
report. After I enter the date and click Ok, both the
boxes disappear and nothing is printed. The connection to
the printer is fine, but its a mystery to me.
-----Original Message-----
Let me re-check that I understand the problem as you have described it -
The following code will open your report in Preview Mode and display your
data correctly:

DoCmd.OpenReport stDocName, acViewPreview, , strWhere

But, when you attempt to use:

DoCmd.OpenReport stDocName, acViewNormal, , strWhere

or

DoCmd.OpenReport stDocName, , , strWhere

Your report does not get sent directly to the printer.

Is my understanding correct?

Do you receive any error messages? If so, please post them.

Is your version of Office/Access up to date on all Service Packs/Releases?

Open the Windows Control Panel - do you have a Default Printer selected?


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


I put in this code
DoCmd.OpenReport stDocName, , , strWhere
Sorry, it didn't print. The code looks fine but just can't
figure out why its not printing this way.
-----Original Message-----
Try leaving out the acViewNormal (but do leave in the
comma as a
placeholder).

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


No, it doesn't print. Infact If I use acPreview instead
of
acViewNormal, it shows the correct Report date and then
if
I print it prints. Why does it not happen with
acPreview??
(direct print)

Thanks for replying immediately.
-----Original Message-----
If you add your strWhere to the arguments for
OpenReport,
as follows,

DoCmd.OpenReport "stDocName", acViewNormal, ,
strWhere

Do you get your report printed with the correct dates?




--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


How can I make the report to print. I need this to be
printed by selecting the date. I have the code but
don't
know why its not working. Can somebody point out
where
is
the mistake.

Dim stDocName As String
Dim strWhere As String
stDocName = "Recap report"
strWhere = "[deposit_date]=#" & Me.deposit_date
& "#"
DoCmd.OpenReport stDocName, acViewNormal

When I click, it shows the msg box saying Now
Printing
on
Printer, then an input Box asking for the date to
enter
the date. But nothing gets printed.
Please help. Thanks in advance


.



.


.
 
This is actually a button on the Form. When the button is
clicked, I want to ask for the date as there are many
reports by date. So, when the date is entered I can view
the appropriate Report. Now, what I am tryig to do is
directly print the Report instead of just viewing and then
printing.
-----Original Message-----
If you are using a "Where" clause (strWhere) in your OpenReport code, you
should not have to respond to a prompt in a dialog box to enter the date.
So, let's check the following:

1. Is the RecordSource of your Report a query with a parameter? If so,
remove the parameter from the query.

2. In the design of your Report, make sure that the RecordSource contains a
field named: deposit_date


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


It shows the msg Box saying " Now Printing 'Recap Report'
to the 'Printer name' on 'IP address'", which is my
default printer, then it opens up the dialog box to enter
the date for the user to enter the date for which to print
report. After I enter the date and click Ok, both the
boxes disappear and nothing is printed. The connection to
the printer is fine, but its a mystery to me.
-----Original Message-----
Let me re-check that I understand the problem as you
have
described it -
The following code will open your report in Preview
Mode
and display your
data correctly:

DoCmd.OpenReport stDocName, acViewPreview, , strWhere

But, when you attempt to use:

DoCmd.OpenReport stDocName, acViewNormal, , strWhere

or

DoCmd.OpenReport stDocName, , , strWhere

Your report does not get sent directly to the printer.

Is my understanding correct?

Do you receive any error messages? If so, please post them.

Is your version of Office/Access up to date on all Service Packs/Releases?

Open the Windows Control Panel - do you have a Default Printer selected?


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


I put in this code
DoCmd.OpenReport stDocName, , , strWhere
Sorry, it didn't print. The code looks fine but just can't
figure out why its not printing this way.
-----Original Message-----
Try leaving out the acViewNormal (but do leave in the
comma as a
placeholder).

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


No, it doesn't print. Infact If I use acPreview instead
of
acViewNormal, it shows the correct Report date and then
if
I print it prints. Why does it not happen with
acPreview??
(direct print)

Thanks for replying immediately.
-----Original Message-----
If you add your strWhere to the arguments for
OpenReport,
as follows,

DoCmd.OpenReport "stDocName", acViewNormal, ,
strWhere

Do you get your report printed with the correct dates?




--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


How can I make the report to print. I need this to be
printed by selecting the date. I have the code but
don't
know why its not working. Can somebody point out
where
is
the mistake.

Dim stDocName As String
Dim strWhere As String
stDocName = "Recap report"
strWhere = "[deposit_date]=#" & Me.deposit_date
& "#"
DoCmd.OpenReport stDocName, acViewNormal

When I click, it shows the msg box saying Now
Printing
on
Printer, then an input Box asking for the date to
enter
the date. But nothing gets printed.
Please help. Thanks in advance


.



.



.


.
 
Please post *all* of the code behind the button on your form. Thanks!



--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


This is actually a button on the Form. When the button is
clicked, I want to ask for the date as there are many
reports by date. So, when the date is entered I can view
the appropriate Report. Now, what I am tryig to do is
directly print the Report instead of just viewing and then
printing.
-----Original Message-----
If you are using a "Where" clause (strWhere) in your OpenReport code, you
should not have to respond to a prompt in a dialog box to enter the date.
So, let's check the following:

1. Is the RecordSource of your Report a query with a parameter? If so,
remove the parameter from the query.

2. In the design of your Report, make sure that the RecordSource contains a
field named: deposit_date


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


It shows the msg Box saying " Now Printing 'Recap Report'
to the 'Printer name' on 'IP address'", which is my
default printer, then it opens up the dialog box to enter
the date for the user to enter the date for which to print
report. After I enter the date and click Ok, both the
boxes disappear and nothing is printed. The connection to
the printer is fine, but its a mystery to me.
-----Original Message-----
Let me re-check that I understand the problem as you have
described it -
The following code will open your report in Preview Mode
and display your
data correctly:

DoCmd.OpenReport stDocName, acViewPreview, , strWhere

But, when you attempt to use:

DoCmd.OpenReport stDocName, acViewNormal, , strWhere

or

DoCmd.OpenReport stDocName, , , strWhere

Your report does not get sent directly to the printer.

Is my understanding correct?

Do you receive any error messages? If so, please post
them.

Is your version of Office/Access up to date on all
Service Packs/Releases?

Open the Windows Control Panel - do you have a Default
Printer selected?


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


I put in this code
DoCmd.OpenReport stDocName, , , strWhere
Sorry, it didn't print. The code looks fine but just
can't
figure out why its not printing this way.
-----Original Message-----
Try leaving out the acViewNormal (but do leave in the
comma as a
placeholder).

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


No, it doesn't print. Infact If I use acPreview
instead
of
acViewNormal, it shows the correct Report date and
then
if
I print it prints. Why does it not happen with
acPreview??
(direct print)

Thanks for replying immediately.
-----Original Message-----
If you add your strWhere to the arguments for
OpenReport,
as follows,

DoCmd.OpenReport "stDocName", acViewNormal, ,
strWhere

Do you get your report printed with the correct
dates?




--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


message
How can I make the report to print. I need this
to be
printed by selecting the date. I have the code but
don't
know why its not working. Can somebody point out
where
is
the mistake.

Dim stDocName As String
Dim strWhere As String
stDocName = "Recap report"
strWhere = "[deposit_date]=#" &
Me.deposit_date
& "#"
DoCmd.OpenReport stDocName, acViewNormal

When I click, it shows the msg box saying Now
Printing
on
Printer, then an input Box asking for the date to
enter
the date. But nothing gets printed.
Please help. Thanks in advance


.



.



.


.
 
Back
Top