A
Angelsnecropolis
"Object Doesn't Support This Property Or Code"
I either need help fixing this code or if someone knows a more simple way to
create the same result it would be much appreciated.
What should happen is:
1. If Replist is null & Mgrlist is null then Questionbox = "Questions - All
Reps" and is the only txtbox visible.
2. If Replist is not null then Questionbox = "Questions - Per Rep".
Questionbox & Repname are the only txtboxes visible.
3. If Mgrlist is not null then Managername = "Questions - Per Mgr".
Managername & Managername1 are the only txtboxes visible.
I know the problem lies in the Takeovers & Escalation (TR & ER) part of the
"If Not IsNull(Me!mgrlist) Then" statement and it causes the textbox
"Questionbox" to not function in the Takeover & Escalations reports. It seems
to only make the first line of code work but the 2nd and 3rd lines of code
don't work. When I take two of the 3 lines out no error. If I take out the
Question & Escalation parts and just leave Takeover then the Takeover reports
works. Same thing for the Escalation report. There is nothing wrong with the
reports or quieries because I literally copied/pasted the QR & Query then
changed all the associations to work with TR & ER. I left the name
"Questionbox" the same on all three reports.
Here are the control source codes for the textboxes on the reports:
Questionbox =IIf(Forms.[Helpgate Menu].replist Is Null,"Questions - All
Reps",null)
Questionbox2 =IIf(Forms.[Helpgate Menu].replist Is Null,null,"Questions -
Per Rep")
Repname =IIf(Forms.[Helpgate Menu].replist Is Null,null,[C/S Rep ID])
Managername1 =IIf([Forms].[Helpgate Menu].[Mgrlist] Is Null,Null,[Mgr])
Managername =IIf(Forms.[Helpgate Menu].Mgrlist Is Null,Null,"Questions - Per
MGR")
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
Reports.Takeovers.Questionbox.Visible = False
Reports.Escalations.Questionbox.Visible = False
End If
Exit_GenerateReportcs_Click:
Exit Sub
Err_GenerateReportcs_Click:
MsgBox Err.Description
Resume Exit_GenerateReportcs_Click
End Sub
I either need help fixing this code or if someone knows a more simple way to
create the same result it would be much appreciated.
What should happen is:
1. If Replist is null & Mgrlist is null then Questionbox = "Questions - All
Reps" and is the only txtbox visible.
2. If Replist is not null then Questionbox = "Questions - Per Rep".
Questionbox & Repname are the only txtboxes visible.
3. If Mgrlist is not null then Managername = "Questions - Per Mgr".
Managername & Managername1 are the only txtboxes visible.
I know the problem lies in the Takeovers & Escalation (TR & ER) part of the
"If Not IsNull(Me!mgrlist) Then" statement and it causes the textbox
"Questionbox" to not function in the Takeover & Escalations reports. It seems
to only make the first line of code work but the 2nd and 3rd lines of code
don't work. When I take two of the 3 lines out no error. If I take out the
Question & Escalation parts and just leave Takeover then the Takeover reports
works. Same thing for the Escalation report. There is nothing wrong with the
reports or quieries because I literally copied/pasted the QR & Query then
changed all the associations to work with TR & ER. I left the name
"Questionbox" the same on all three reports.
Here are the control source codes for the textboxes on the reports:
Questionbox =IIf(Forms.[Helpgate Menu].replist Is Null,"Questions - All
Reps",null)
Questionbox2 =IIf(Forms.[Helpgate Menu].replist Is Null,null,"Questions -
Per Rep")
Repname =IIf(Forms.[Helpgate Menu].replist Is Null,null,[C/S Rep ID])
Managername1 =IIf([Forms].[Helpgate Menu].[Mgrlist] Is Null,Null,[Mgr])
Managername =IIf(Forms.[Helpgate Menu].Mgrlist Is Null,Null,"Questions - Per
MGR")
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
Reports.Takeovers.Questionbox.Visible = False
Reports.Escalations.Questionbox.Visible = False
End If
Exit_GenerateReportcs_Click:
Exit Sub
Err_GenerateReportcs_Click:
MsgBox Err.Description
Resume Exit_GenerateReportcs_Click
End Sub