Object doesnt support this property...

A

Angelsnecropolis

When I click on a button I receive this msg: "Object doesnt support this
property or method"

I know the problem lies within the section of code below because I get no
error when I remove it and the error when it's there but I can't figure out
what I'm doing wrong. Also, the error only populates when another combobox
(Reportlistcs) is Null.

If IsNull(Me!Replist) Then
Reports.Questions.Repname.Visible = True
End If

Replist is a combobox on the form. Repname is a textbox in the report titled
Questions.

I have another piece of code in the same sub that is almost identical and it
doesn't cause the error:

If Not IsNull(Me!mgrlist) Then
Reports.Questions.Questionbox.Visible = False
End If

Here is the whole code:

Private Sub GenerateReportcs_Click()
On Error GoTo Err_GenerateReportcs_Click

If IsNull(Me!Reportlistcs) Then
MsgBox "You must select a C/S Report first."
Reportlistcs.SetFocus
Else
DoCmd.OpenReport (Me!Reportlistcs), acPreview
End If

If Not IsNull(Me!mgrlist) Then
Reports.Questions.Questionbox.Visible = False
End If

If IsNull(Me!Replist) Then
Reports.Questions.Repname.Visible = True
End If

If Not IsNull(Me!Replist) Then
If Not IsNull(Me!mgrlist) Then
On Error GoTo Err_GenerateReportcs_Click
MsgBox "Please Choose Manager Name or Rep Name."
Else
DoCmd.OpenReport (Me!Reportlistcs), acPreview
End If
End If

Exit_GenerateReportcs_Click:

Exit Sub
Err_GenerateReportcs_Click:
MsgBox Err.Description
Resume Exit_GenerateReportcs_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top