Multiple print - VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Quite simple bit of code to print multiple copies of ReportName but I am
baffled by this one and am obviously doing something really stupid. The code
works - but after running (and printing – multiple copies as set by
[CardCount] combo) it minimises (not close but minimise) the main form (in
fact all forms). V Strange. I don't really want to add anything daft like a
Maximise until I know where I'm going wrong.

Private Sub PrintCount_AfterUpdate()
DoCmd.SelectObject acReport, "ReportName", True
DoCmd.PrintOut , , , , Me![PrintCount]
Exit Sub
Me.PrintCount.Visible = False
End Sub


Any ideas would be gratefully appreciated
 
Managed to get it sorted (sort of) but the form still minimise for a split
second - but the DoCmd.SelectObject acForm and the SetFocus stuff puts it all
back in place. Still V Strange.

Private Sub CardCount_AfterUpdate()
DoCmd.SelectObject acReport, "ReportName", True
DoCmd.PrintOut , , , , Me![CardCount]
DoCmd.SelectObject acForm, "MainForm", False
Me.SubForm.SetFocus
End Sub

Anyone have any ideas as to why this would happen

Cheers and thanks in advance
 
Back
Top