print command

  • Thread starter Thread starter Rpettis31
  • Start date Start date
R

Rpettis31

Not sure why this command prints my exact form but I was wondering how I can
modify this code to ask the user the number of copies are needed to be
printed.
Private Sub cmdHoldTag_Click()

Dim StrCriterion As String

StrCriterion = "[DMRID]=" & Me.DMRID

DoCmd.OpenReport "rptQualityHold", acSnapshot, , StrCriterion

Exit Sub
 
Does this help?

Sub SetPrinter(strFormname As String)

DoCmd.OpenForm FormName:=strFormname, view:=acDesign, _
datamode:=acFormEdit, windowmode:=acHidden

With Forms(form1).Printer

.TopMargin = 1440
.BottomMargin = 1440
.LeftMargin = 1440
.RightMargin = 1440

.ColumnSpacing = 360
.RowSpacing = 360

.ColorMode = acPRCMColor
.DataOnly = False
.DefaultSize = False
.ItemSizeHeight = 2880
.ItemSizeWidth = 2880
.ItemLayout = acPRVerticalColumnLayout
.ItemsAcross = 6

.Copies = 1
.Orientation = acPRORLandscape
.Duplex = acPRDPVertical
.PaperBin = acPRBNAuto
.PaperSize = acPRPSLetter
.PrintQuality = acPRPQMedium

End With

DoCmd.Close objecttype:=acForm, objectname:=strFormname, _
Save:=acSaveYes


End Sub
 
I was looking for somthing where a message box would pop up and ask how many
copies. My code simply prints one copy everytime the command button is
selected.
It prints a report of a single record.

Access101 said:
Does this help?

Sub SetPrinter(strFormname As String)

DoCmd.OpenForm FormName:=strFormname, view:=acDesign, _
datamode:=acFormEdit, windowmode:=acHidden

With Forms(form1).Printer

.TopMargin = 1440
.BottomMargin = 1440
.LeftMargin = 1440
.RightMargin = 1440

.ColumnSpacing = 360
.RowSpacing = 360

.ColorMode = acPRCMColor
.DataOnly = False
.DefaultSize = False
.ItemSizeHeight = 2880
.ItemSizeWidth = 2880
.ItemLayout = acPRVerticalColumnLayout
.ItemsAcross = 6

.Copies = 1
.Orientation = acPRORLandscape
.Duplex = acPRDPVertical
.PaperBin = acPRBNAuto
.PaperSize = acPRPSLetter
.PrintQuality = acPRPQMedium

End With

DoCmd.Close objecttype:=acForm, objectname:=strFormname, _
Save:=acSaveYes


End Sub



Rpettis31 said:
Not sure why this command prints my exact form but I was wondering how I can
modify this code to ask the user the number of copies are needed to be
printed.
Private Sub cmdHoldTag_Click()

Dim StrCriterion As String

StrCriterion = "[DMRID]=" & Me.DMRID

DoCmd.OpenReport "rptQualityHold", acSnapshot, , StrCriterion

Exit Sub
 
Check out Terry Wickenden's web site
(http://www.tkwickenden.clara.net/list/listp.htm). Specifically, select the
Code Example, then select the P (for print) option.

You want to look for the acCmdPrint argument of the docmd.runcommand method.

HTH
Dale


Rpettis31 said:
I was looking for somthing where a message box would pop up and ask how
many
copies. My code simply prints one copy everytime the command button is
selected.
It prints a report of a single record.

Access101 said:
Does this help?

Sub SetPrinter(strFormname As String)

DoCmd.OpenForm FormName:=strFormname, view:=acDesign, _
datamode:=acFormEdit, windowmode:=acHidden

With Forms(form1).Printer

.TopMargin = 1440
.BottomMargin = 1440
.LeftMargin = 1440
.RightMargin = 1440

.ColumnSpacing = 360
.RowSpacing = 360

.ColorMode = acPRCMColor
.DataOnly = False
.DefaultSize = False
.ItemSizeHeight = 2880
.ItemSizeWidth = 2880
.ItemLayout = acPRVerticalColumnLayout
.ItemsAcross = 6

.Copies = 1
.Orientation = acPRORLandscape
.Duplex = acPRDPVertical
.PaperBin = acPRBNAuto
.PaperSize = acPRPSLetter
.PrintQuality = acPRPQMedium

End With

DoCmd.Close objecttype:=acForm, objectname:=strFormname, _
Save:=acSaveYes


End Sub



Rpettis31 said:
Not sure why this command prints my exact form but I was wondering how
I can
modify this code to ask the user the number of copies are needed to be
printed.
Private Sub cmdHoldTag_Click()

Dim StrCriterion As String

StrCriterion = "[DMRID]=" & Me.DMRID

DoCmd.OpenReport "rptQualityHold", acSnapshot, , StrCriterion

Exit Sub
 
Back
Top