linklerden yararlandım aşağıdaki kodları denedim yine olmadı L
Option Compare Database
Private Type str_DEVMODE
RGB As String * 94
End Type
Private Type type_DEVMODE
strDeviceName As String * 32
intSpecVersion As Integer
intDriverVersion As Integer
intSize As Integer
intDriverExtra As Integer
lngFields As Long
intOrientation As Integer
intPaperSize As Integer
intPaperLength As Integer
intPaperWidth As Integer
intScale As Integer
intCopies As Integer
intDefaultSource As Integer
intPrintQuality As Integer
intColor As Integer
intDuplex As Integer
intResolution As Integer
intTTOption As Integer
intCollate As Integer
strFormName As String * 32
lngPad As Long
lngBits As Long
lngPW As Long
lngPH As Long
lngDFI As Long
lngDFr As Long
End Type
Private Sub Komut115_Click()
'Sayfa uzunluğu ve genişliğini ayarlama
Dim DevString As str_DEVMODE
Dim DM As type_DEVMODE
Dim strDevModeExtra As String
Dim rpt As Report
Dim intResponse As Integer
' Opens report in Design view.
DoCmd.OpenReport "AVANSDOKUM", acDesign
Set rpt = Reports("AVANSDOKUM")
If Not IsNull(rpt.PrtDevMode) Then
strDevModeExtra = rpt.PrtDevMode
' Gets current DEVMODE structure.
DevString.RGB = strDevModeExtra
LSet DM = DevString
If DM.intPaperSize = 256 Then
' Display user-defined size.
intResponse = MsgBox("The current custom page size is " & _
DM.intPaperWidth / 254 & " inches wide by " & _
DM.intPaperLength / 254 & " inches long. Do you want " & _
"to change the settings?", vbYesNo + vbQuestion)
Else
' Currently not user-defined.
intResponse = MsgBox("The report does not have a custom page size. " & _
"Do you want to define one?", vbYesNo + vbQuestion)
End If
If intResponse = vbYes Then
' User wants to change settings. Initialize fields.
DM.lngFields = DM.lngFields Or DM.intPaperSize Or _
DM.intPaperLength Or DM.intPaperWidth
' Set custom page.
DM.intPaperSize = 256
' Prompt for length and width.
DM.intPaperLength = InputBox("Please enter page length in inches.") * 254
DM.intPaperWidth = InputBox("Please enter page width in inches.") * 254
' Update property.
LSet DevString = DM
Mid(strDevModeExtra, 1, 94) = DevString.RGB
rpt.PrtDevMode = strDevModeExtra
End If
End If
Set rpt = Nothing
'DoCmd.Close acReport, "AVANSDOKUM", acSaveYes
DoCmd.PrintOut (AVANSDOKUM)
End Sub
Soru Türü: Yazılım
İşletim Sistemi: Windows 7
Sistem Özellikleri:
i5 750, 4 GB DDR3 1600, 7900 GS, 580 Recom Raid0
İnternet Tarayıcı: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)