Hi guys
I am trying to find out the total number of pages in a report but its giving me the above error message.
Can anyone please figure it out.
Regards
AMan
I am trying to find out the total number of pages in a report but its giving me the above error message.
Code:
Dim MyPageNum As Integer
Dim stDocName As String
i = Reports("a1").Pages
For MyPageNum = 1 To i
DoCmd.SelectObject acReport, "Students Information Report", True
DoCmd.PrintOut acPages, MyPageNum, MyPageNum
DoCmd.SelectObject acReport, "a1", True
DoCmd.PrintOut acPages, MyPageNum, MyPageNum
Next MyPageNum
Can anyone please figure it out.
Regards
AMan