I forgot to mention that error occurs when I try to look at the references in the Visual Basic window.
Here is a sample of the code. There is no problem with it on an XP laptop.
-
Option Compare Database
-
Option Explicit
-
-
Private Sub cboProperty_AfterUpdate()
-
-
Me.cboFlat.Requery
-
-
End Sub
-
-
Private Sub cmdClose_Click()
-
-
On Error GoTo Err_cmdClose_Click
-
-
DoCmd.OpenForm "frmMainMenu", acNormal
-
DoCmd.Close acForm, "frmReports"
-
-
Exit_cmdClose_Click:
-
Exit Sub
-
-
Err_cmdClose_Click:
-
MsgBox Err.Description
-
Resume Exit_cmdClose_Click
-
-
End Sub
-
-
Private Sub cmdLabelP1_Click()
-
-
-
DoCmd.OpenReport "rptOwners_Labels", acViewPreview
-
DoCmd.RunMacro "mrToolbar.ShowPrintTool"
-
End Sub
-
-
Private Sub cmdLabelP2_Click()
-
-
DoCmd.OpenReport "rptOwners_Labels_P2", acViewPreview
-
DoCmd.RunMacro "mrToolbar.ShowPrintTool"
-
End Sub
-
-
Private Sub cmdPrint_Click()
-
-
Dim Msg As String, Msg2 As String, Response As String, Style As String
-
-
Msg = "There are no Arrears for " & "" & Forms![frmReports].[cboProperty].Column(1)
-
Style = vbOKOnly + vbInformation + vbDefaultButton1
-
-
Msg2 = "There are no Outstanding Actions for " & "" & Forms![frmReports].[cboProperty].Column(1)
-
-
On Error GoTo Err_cmdPrint_Click
-
-
If Me.lstReports = "rptInvoice" Then
-
DoCmd.SetWarnings False
-
DoCmd.OpenQuery "qupdInvoicesPrinted"
-
DoCmd.SetWarnings True
-
End If
-
-
If Me.lstReports = "rptServiceChargeArrearsRpt" Then
-
DoCmd.SetWarnings False
-
DoCmd.OpenQuery "qdelServiceChargeArrearsTotal"
-
DoCmd.OpenQuery "qappServiceChargeASrrearsTotalCY"
-
DoCmd.OpenQuery "qappServiceChargeASrrearsTotalPY"
-
DoCmd.SetWarnings True
-
End If
-
-
If Me.lstReports = "rptInvoiceArrears" And IsNull(DLookup("[PropertyID]", "qselInvoicesArrearsRpt")) Then
-
Response = MsgBox(Msg, Style)
-
If Response = 1 Then
-
GoTo 10
-
End If
-
End If
-
-
If Me.lstReports = "rptGroundRentArrears" And IsNull(DLookup("[PropertyID]", "qselGroundRentArrears")) Then
-
Response = MsgBox(Msg, Style)
-
If Response = 1 Then
-
GoTo 10
-
End If
-
End If
-
-
If Me.lstReports = "rptPropertyActions" And IsNull(DLookup("[PropertyID]", "qselPropertyAction")) Then
-
Response = MsgBox(Msg2, Style)
-
If Response = 1 Then
-
GoTo 10
-
End If
-
End If
-
'rptPropertyActions
-
DoCmd.OpenReport Me.lstReports, acViewPreview
-
DoCmd.RunMacro "mrToolbar.ShowPrintTool"
-
-
10
-
-
Exit_cmdPrint_Click:
-
Exit Sub
-
-
Err_cmdPrint_Click:
-
MsgBox Err.Description
-
Resume Exit_cmdPrint_Click
-
-
End Sub
-
-
-
-
Private Sub Command17_Click()
-
-
DoCmd.OpenReport "rptOwners_Labels_FH_P2", acViewPreview
-
DoCmd.RunMacro "mrToolbar.ShowPrintTool"
-
End Sub
-
-
Private Sub Command18_Click()
-
-
DoCmd.OpenReport "rptOwners_Labels_FH_P1", acViewPreview
-
DoCmd.RunMacro "mrToolbar.ShowPrintTool"
-
End Sub
-
-
Private Sub Form_Open(Cancel As Integer)
-
On Error GoTo Err_Form_Open
-
-
DoCmd.Maximize
-
-
Me.cboFlat.Visible = False
-
Me.cboProperty.Visible = False
-
Me.cboYear.Visible = False
-
Me.cboHalfYear.Visible = False
-
-
Exit_Form_Open:
-
Exit Sub
-
-
Err_Form_Open:
-
MsgBox Err.Description
-
Resume Exit_Form_Open
-
-
End Sub
-
-
Private Sub lstReports_Click()
-
-
If Me.lstReports = "rptContactProperty" Or Me.lstReports = "rptBillExtraInvoice" Then
-
Me.cboFlat.Visible = True
-
Me.cboProperty.Visible = True
-
Else
-
Me.cboFlat.Visible = False
-
Me.cboProperty.Visible = False
-
End If
-
-
If Me.lstReports = "rptInvoiceArrears" Or Me.lstReports = "rptPropertyActions" Or Me.lstReports = "rptInvoiceDetails" Or Me.lstReports = "rptOwners" Or Me.lstReports = "rptInvoice_Phase2" Then
-
Me.cboProperty.Visible = True
-
End If
-
-
If Me.lstReports = "rptInvoice" Or Me.lstReports = "rptInvoiceRedecWindows" Or Me.lstReports = "rptInvoiceRedecoration" Then
-
Me.cboProperty.Visible = True
-
Me.cboYear.Visible = True
-
Else
-
Me.cboYear.Visible = False
-
End If
-
-
If Me.lstReports = "rptInvoiceReprint" Then
-
Me.cboFlat.Visible = True
-
Me.cboProperty.Visible = True
-
Me.cboYear.Visible = True
-
Else
-
'Me.cboYear.Visible = False
-
End If
-
-
If Me.lstReports = "rptGroundRentInvoice" Or Me.lstReports = "rptGroundRentArrears" Then
-
Me.cboHalfYear.Visible = True
-
Me.lblHalfYear.Visible = True
-
Me.cboYear.Visible = True
-
Else
-
Me.cboHalfYear.Visible = False
-
Me.lblHalfYear.Visible = False
-
Me.cboYear.Visible = False
-
End If
-
-
End Sub
-
Thank you for your help in this matter. I am not a experienced programmer, I try an learn as I go along.