Help with report

  • Thread starter Aya via AccessMonster.com
  • Start date
A

Aya via AccessMonster.com

Hi, I've used a VBA coding I've found in a forum and decided to give it a try.


What the coding do is to print the current record I'm seeing in my form
instead of print all of the records I've in the report. It searches the
current record by matching the primary key of the form and the report, then
it prints. It works the way I wanted...but a problem appear after I went to
check how it printed my record.

My report is a Landscape orientation and the coding printed the current
record of my report in the Portrait orientation. How can I do to make the
coding print the current record in Landscape?

Here's the coding I've in my cmdPrint button on one of my forms:

Private Sub cmdPrint_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Título] = """ & Me.[Título] & """"
DoCmd.OpenReport "Almacén", acViewNormal, , strWhere
End If

End Sub

Any help here is appreciated.

Thanx.
 
F

fredg

Hi, I've used a VBA coding I've found in a forum and decided to give it a try.

What the coding do is to print the current record I'm seeing in my form
instead of print all of the records I've in the report. It searches the
current record by matching the primary key of the form and the report, then
it prints. It works the way I wanted...but a problem appear after I went to
check how it printed my record.

My report is a Landscape orientation and the coding printed the current
record of my report in the Portrait orientation. How can I do to make the
coding print the current record in Landscape?

Here's the coding I've in my cmdPrint button on one of my forms:

Private Sub cmdPrint_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Título] = """ & Me.[Título] & """"
DoCmd.OpenReport "Almacén", acViewNormal, , strWhere
End If

End Sub

Any help here is appreciated.

Thanx.

Your code has nothing to do with whether the report is Landscape of
Portrait.

Open the Report in Design View.
Click on File + Page Setup + Page
Set the Report to Landscape.
Save the changes.

If that does not always work, and you have Access 2000, then:

If you are using Access 2000 this is a known bug and is documented in
the Microsoft Knowledgebase article:
Q245021 'List of Fixed Problems in Microsoft Office 2000 Service
Release 1/1a (SR-1/SR-1a)'
And specifically:
Q240826 'Lost Printer Settings when Name Autocorrect is turned on'

Turn off the Name AutoCorrect feature as a temporary 'fix'.
Then download and install the Service Release 1/1a.

Even if you are not using Access 2000, turn off the Name AutoCorrect.
Tools + Options + General Tab.
 
A

Aya via AccessMonster.com

That's what I did. I opened my report in Design View, went to Page Setup and
set my report page to Landscape and saved it. I changed my report to Print
Preview and it was in the Landscape orientation.

But when I tried again to print the document, it printed the report in
Portrait and not in Landscape. That is my problem here.

And the Service Release, I've tried to download it before, but I don't have
the privileges to download it in my work's computer because of security. I
use Access 2000.

I went to Options in the Tools menu. Then to General tab and I see a box
named "Name AutoCorrect" which has three check boxes in it:

1. Track name AutoCorrect info
2. Perform name AutoCorrect
3. Log name AutoCorrect changes

It only has the first two check boxes selected. Do I have to remove both
options to stop changing my page to Portrait?

Suggestions?
 
F

fredg

That's what I did. I opened my report in Design View, went to Page Setup and
set my report page to Landscape and saved it. I changed my report to Print
Preview and it was in the Landscape orientation.

But when I tried again to print the document, it printed the report in
Portrait and not in Landscape. That is my problem here.

And the Service Release, I've tried to download it before, but I don't have
the privileges to download it in my work's computer because of security. I
use Access 2000.

I went to Options in the Tools menu. Then to General tab and I see a box
named "Name AutoCorrect" which has three check boxes in it:

1. Track name AutoCorrect info
2. Perform name AutoCorrect
3. Log name AutoCorrect changes

It only has the first two check boxes selected. Do I have to remove both
options to stop changing my page to Portrait?

Suggestions?

Uncheck "Track Name Auto Correct info changes' which will in turn
uncheck the others.
 
A

Aya via AccessMonster.com

Kay, I will do that and later I'll tell you how it went.
That's what I did. I opened my report in Design View, went to Page Setup and
set my report page to Landscape and saved it. I changed my report to Print
[quoted text clipped - 18 lines]
Suggestions?

Uncheck "Track Name Auto Correct info changes' which will in turn
uncheck the others.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top