Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Object doesnt support this property...

Geek News

Object doesnt support this property...
Angelsnecropolis 11/27/2008 8:57:00 PM
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
RE: Object doesnt support this property...
Angelsnecropolis 11/27/2008 9:07:01 PM
Nevermind. I figured it out.

"Angelsnecropolis" wrote:

[Quoted Text]
> 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

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net