Friday, 27 September 2013

Access 2007, VBA: Printing only the CURRENT selected record from three forms

Access 2007, VBA: Printing only the CURRENT selected record from three forms

This is my code so far. This prints the current selected record from my
first form. I want the button to also print current selected records from
2 other forms (they have the same emp name).
Dim myform As Form
Dim pageno As Integer
pageno = Me.CurrentRecord
Set myform = Screen.ActiveForm
DoCmd.SelectObject acForm, myform.Name, True
DoCmd.PrintOut acPages, pageno, pageno, , 1
DoCmd.SelectObject acForm, myform.Name, False

No comments:

Post a Comment