Run Timer Error 2427

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??
 
G

Guest

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??
 
J

John Spencer

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??
 
G

Guest

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??
 
D

Douglas J Steele

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??
 

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