Dear all
I am looking for a possible way to ave a landscape printing of my Access Report. From the VB file I call the access report and is getting printed in Potrait. I want to change it to landscape.
My code is as follows :
Private Sub cmdRep_Click()
Dim strpath As String
Dim objaccess As Access.Application
Set objaccess = New Access.Application
strpath = App.Path & "\final_ant.mdb"
objaccess.OpenCurrentDatabase strpath
objaccess.DoCmd.OpenReport "final_rep", acViewNormal
objaccess.CloseCurrentDatabase
End Sub
And my report is being called in Access which has the following VB code behind it.
Private Sub Report_Open(Cancel As Integer)
Set cn = New ADODB.Connection
Dim sql As String
If cn.State = 1 Then
cn.Close
End If
cn.Open ("provider=Microsoft.jet.OLEDB.4.0;Data Source=c:\xxx.mdb;" & "Persist Security Info=False"
Set rs = New ADODB.Recordset
rs.Open "select * from report_data", cn, adOpenKeyset, adLockOptimistic
rs.MoveFirst
Set rs1 = New ADODB.Recordset
rs1.Open "select * from duplicate where new_card_no ='" & rs.Fields("cardno" & "'", cn, adOpenKeyset, adLockOptimistic
rs.MoveFirst
End Sub
*********************************************
Please help me getting the landscape printout of this report.
Thanks in advance
Himanshu Madan.
I am looking for a possible way to ave a landscape printing of my Access Report. From the VB file I call the access report and is getting printed in Potrait. I want to change it to landscape.
My code is as follows :
Private Sub cmdRep_Click()
Dim strpath As String
Dim objaccess As Access.Application
Set objaccess = New Access.Application
strpath = App.Path & "\final_ant.mdb"
objaccess.OpenCurrentDatabase strpath
objaccess.DoCmd.OpenReport "final_rep", acViewNormal
objaccess.CloseCurrentDatabase
End Sub
And my report is being called in Access which has the following VB code behind it.
Private Sub Report_Open(Cancel As Integer)
Set cn = New ADODB.Connection
Dim sql As String
If cn.State = 1 Then
cn.Close
End If
cn.Open ("provider=Microsoft.jet.OLEDB.4.0;Data Source=c:\xxx.mdb;" & "Persist Security Info=False"
Set rs = New ADODB.Recordset
rs.Open "select * from report_data", cn, adOpenKeyset, adLockOptimistic
rs.MoveFirst
Set rs1 = New ADODB.Recordset
rs1.Open "select * from duplicate where new_card_no ='" & rs.Fields("cardno" & "'", cn, adOpenKeyset, adLockOptimistic
rs.MoveFirst
End Sub
*********************************************
Please help me getting the landscape printout of this report.
Thanks in advance
Himanshu Madan.