"Operation not allowed when object is open"
-
ElseIf optSuppOrder.Value = True Then Load deMain With deMain .SupplierOrderAudit_Grouping txtUser.Text, CDate(Text5.Text), CDate(Text6.Text) End With SupplierOrderAudit.Refresh If SupplierOrderAudit.Visible = False Then SupplierOrderAudit.Show End If End If if the above option button is chosen, the intended purpose is that the report is generated. However, occasionally, when the command button is pressed, it throws the above run time error pointing to the report line, why is this? any help would be greatly appreciated or if you need any additional info.
-
ElseIf optSuppOrder.Value = True Then Load deMain With deMain .SupplierOrderAudit_Grouping txtUser.Text, CDate(Text5.Text), CDate(Text6.Text) End With SupplierOrderAudit.Refresh If SupplierOrderAudit.Visible = False Then SupplierOrderAudit.Show End If End If if the above option button is chosen, the intended purpose is that the report is generated. However, occasionally, when the command button is pressed, it throws the above run time error pointing to the report line, why is this? any help would be greatly appreciated or if you need any additional info.
Just plucking at straws but the error may occur if deMain is already loaded (e.g. not unloaded properly from a previous report???). Maybe you should look into creating a new instance of deMain each time you need a report.... If this isn't where you are receiving the errors thenignore my post :) Rhys Kirk
-
ElseIf optSuppOrder.Value = True Then Load deMain With deMain .SupplierOrderAudit_Grouping txtUser.Text, CDate(Text5.Text), CDate(Text6.Text) End With SupplierOrderAudit.Refresh If SupplierOrderAudit.Visible = False Then SupplierOrderAudit.Show End If End If if the above option button is chosen, the intended purpose is that the report is generated. However, occasionally, when the command button is pressed, it throws the above run time error pointing to the report line, why is this? any help would be greatly appreciated or if you need any additional info.
The error you mention generally occurrs when attempting to open an ADODB.Recordset object when it's already open - if you're reporting from a DB, this will prob be the cause, but suspect that it won't be in your code? Does that help? "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox