I am trying to display/open MS Access report and I get: RunTime error 2486 - You can't not carry out this action at the present time on this line of code:
DoCmd.OpenReport stDocName, acViewNormal
Below is my module:
Set rsUnclaimedRptqry = dbUnclaimed.OpenRecordset("SELECT DISTINCT tblUnclaimed.L1L2, tblUnclaimed.PassNumber, tblUnclaimed.EmployeeName, tblUnclaimed.Status " _
& "FROM tblUnclaimed LEFT JOIN EmployeeInfo ON (tblUnclaimed.PassNumber = EmployeeInfo.Pass_Number) AND (tblUnclaimed.L1L2 = EmployeeInfo.L1L2) " _
& "WHERE (((tblUnclaimed.Status) In ('A','E','U')) AND ((Len([EmployeeInfo].[Status]))=1)) " _
& "ORDER BY tblUnclaimed.L1L2, tblUnclaimed.PassNumber;")
'Populate Report Table:
'----------------------
Set rsUnclaimedtbl = dbUnclaimed.OpenRecordset("tblUnclaimedChk_Msg", dbOpenDynaset)
rsUnclaimedRptqry.MoveFirst
Do Until rsUnclaimedRptqry.EOF = True
rsUnclaimedtbl.AddNew
rsUnclaimedtbl![L1L2] = rsUnclaimedRptqry![L1L2]
rsUnclaimedtbl![PassNumber] = rsUnclaimedRptqry![PassNumber]
rsUnclaimedtbl![EmployeeName] = rsUnclaimedRptqry![EmployeeName]
rsUnclaimedtbl![Status] = rsUnclaimedRptqry![Status]
rsUnclaimedtbl.Update
rsUnclaimedRptqry.MoveNext
Loop
Ans = MsgBox("Would you like to View this report?", vbYesNo, "FTP Transmission")
If Ans = vbYes Then GoTo ViewReport
ViewReport:
'------------
Dim stDocName As String
stDocName = "RptUnclaimedChk_Msgs"
'Note: "RptUnclaimedChk_Msgs" is the name of the report in my database
DoCmd.OpenReport stDocName, acViewNormal
Any insight will be appreciated.
tgifgemini