Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2002
    Location
    Billings, MT
    Posts
    29

    Unanswered: Object Required Problems

    I'm trying to write a routine that will print a long-form report if a checkbox named chkRCP1 is true and the short-form if it is false. But I keep getting an object required error message. I've tried about 50 different things but nothing seems to work. Maybe I've been looking at this too long and I'm just missing something. Any suggestions?

    Private Sub cmdPrintFSEReport_Click()
    On Error GoTo Err_cmdPrintFSEInspReport_Click

    Dim varDocName As String
    Dim CheckRCP As Object
    Set CheckRCP = chkRCP1

    If chkRCP1.Value Is Yes Then
    MsgBox "FSE Inspection Report Long-Form"
    varDocName = "FSE Inspection Report Long-Form"
    ElseIf ckhRCP1.Value Is No Then
    MsgBox "FSE Inspection Report Short-Form"
    varDocName = "FSE Inspection Report Short-Form"
    Else
    Exit Sub
    End If

    Refresh

    DoCmd.OpenReport varDocName, acPreview

    Exit_cmdPrintFSEInspReport_Click:
    Exit Sub

    Err_cmdPrintFSEInspReport_Click:
    MsgBox Err.Description
    Resume Exit_cmdPrintFSEInspReport_Click

    End Sub

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    On what line are you getting the error on?

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Don't bother declaring the CheckRCP Object. Call it directly.

    If chkRCP1 = -1 Then
    etc

  4. #4
    Join Date
    Jul 2002
    Location
    Billings, MT
    Posts
    29

    Object Required Problems

    I thought I had tried that before and it didn't work. But I made the change to call it directly and it work fine. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •