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.
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.