Run Timer Error 2427

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Trying to run a report I get this message and a descriptor telling me I
entered an expression that has no value. When I debug this is the code it
goes to: (the highlight is at If Me![Maint] = "yes" then)

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim i As Integer

If Me![Maint] = "Yes" Then
For i = 0 To Me.Controls.Count - 1
If Me.Controls(i).Tag = "Maint" Then
Me.Controls(i).Visible = True
End If
Next
Else
For i = 0 To Me.Controls.Count - 1
If Me.Controls(i).Tag = "Maint" Then
Me.Controls(i).Visible = False
End If
Next
End If
End Sub

Any thoughts??
 
Didn't help. Still not working

John Spencer said:
Not sure, but I would try Me.Maint vice Me!Maint

Tom said:
Trying to run a report I get this message and a descriptor telling me I
entered an expression that has no value. When I debug this is the code it
goes to: (the highlight is at If Me![Maint] = "yes" then)

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim i As Integer

If Me![Maint] = "Yes" Then
For i = 0 To Me.Controls.Count - 1
If Me.Controls(i).Tag = "Maint" Then
Me.Controls(i).Visible = True
End If
Next
Else
For i = 0 To Me.Controls.Count - 1
If Me.Controls(i).Tag = "Maint" Then
Me.Controls(i).Visible = False
End If
Next
End If
End Sub

Any thoughts??
 
What is Maint? You are testing for the string "YES", is it possible that
the control is a true/false control and you should be testing for True vice
"yes"?

Do you have a control that has that name on the report?


Tom said:
Didn't help. Still not working

John Spencer said:
Not sure, but I would try Me.Maint vice Me!Maint

Tom said:
Trying to run a report I get this message and a descriptor telling me I
entered an expression that has no value. When I debug this is the code
it
goes to: (the highlight is at If Me![Maint] = "yes" then)

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim i As Integer

If Me![Maint] = "Yes" Then
For i = 0 To Me.Controls.Count - 1
If Me.Controls(i).Tag = "Maint" Then
Me.Controls(i).Visible = True
End If
Next
Else
For i = 0 To Me.Controls.Count - 1
If Me.Controls(i).Tag = "Maint" Then
Me.Controls(i).Visible = False
End If
Next
End If
End Sub

Any thoughts??
 
Yes, [Maint] is a control on the form and we are testing if it has a "Yes"
value in it. Either way, the code isn't working. Don't understand what
"vice" is

John Spencer said:
What is Maint? You are testing for the string "YES", is it possible that
the control is a true/false control and you should be testing for True vice
"yes"?

Do you have a control that has that name on the report?


Tom said:
Didn't help. Still not working

John Spencer said:
Not sure, but I would try Me.Maint vice Me!Maint

Trying to run a report I get this message and a descriptor telling me I
entered an expression that has no value. When I debug this is the code
it
goes to: (the highlight is at If Me![Maint] = "yes" then)

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim i As Integer

If Me![Maint] = "Yes" Then
For i = 0 To Me.Controls.Count - 1
If Me.Controls(i).Tag = "Maint" Then
Me.Controls(i).Visible = True
End If
Next
Else
For i = 0 To Me.Controls.Count - 1
If Me.Controls(i).Tag = "Maint" Then
Me.Controls(i).Visible = False
End If
Next
End If
End Sub

Any thoughts??
 
John's spellchecker was probably helping him... I'm sure he meant "you
should be testing for True versus 'Yes'"

While Access may call them Yes/No fields, they're really boolean fields,
with values of True or False (not "True" or "False")

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Tom said:
Yes, [Maint] is a control on the form and we are testing if it has a "Yes"
value in it. Either way, the code isn't working. Don't understand what
"vice" is

John Spencer said:
What is Maint? You are testing for the string "YES", is it possible that
the control is a true/false control and you should be testing for True vice
"yes"?

Do you have a control that has that name on the report?


Tom said:
Didn't help. Still not working

:

Not sure, but I would try Me.Maint vice Me!Maint

Trying to run a report I get this message and a descriptor telling me I
entered an expression that has no value. When I debug this is the code
it
goes to: (the highlight is at If Me![Maint] = "yes" then)

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim i As Integer

If Me![Maint] = "Yes" Then
For i = 0 To Me.Controls.Count - 1
If Me.Controls(i).Tag = "Maint" Then
Me.Controls(i).Visible = True
End If
Next
Else
For i = 0 To Me.Controls.Count - 1
If Me.Controls(i).Tag = "Maint" Then
Me.Controls(i).Visible = False
End If
Next
End If
End Sub

Any thoughts??
 
Back
Top