Run Time Error 424 "Object Required"

paulS30berks

Registered User.
Local time
Today, 03:12
Joined
Jul 19, 2005
Messages
116
I wondered if someone could help.

i am running a report from Access and have set up a label within the detail line to include a sequence no. to the results.

I have included the code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
xx = xx + 0
LblSeqNo.Caption = CStr(xx)

If Movement = 1 Then
Movement.Visible = True
Else
Movement.Visible = False
End If


End Sub

But receive the error: Run Time Error 424 "Object Required"

Can anyone help?

Thanks
 
What line causes the error?
What data type is xx?
Why do you add zero to xx?

You get this error if you treat a variable that is not an object as if it is an object.
Code:
Sub Error424()
   Dim i As Variant
   i = 5
   [COLOR="Green"]'this line causes error 424 because i is not an object[/COLOR]
   Debug.Print i.Caption
End Sub
I suspect that either "LblSeqNo" and/or "Movement" are not valid controls on your report.
 
Many thanks for your reply.

The second line : Movement.Visible = False is causing the problem, the data type is variable.

My caption starts at 0 and next live + 1 so a sequence is built.
 

Users who are viewing this thread

Back
Top Bottom