Object or class does not support the set of events???? Help??? (1 Viewer)

stephaniechongg

Registered User.
Local time
Today, 16:49
Joined
Feb 5, 2016
Messages
15
I've been creating this form for pages now and only today does this error occur, however, when I open the VBA to view and close it again, the form continues to work normally. This error is caused by the On Load Event and Mouse Move Event.

My form basically has a date and time on the header

In the body there is an analogue clock that i got online, and interactive labels which have multiple MouseMove events. The Labels are M I N I M A L I S T. And upon hovering each letter, an arrow would be set to visible.

This is the code for my form

Code:
Option Compare Database
Dim start As Integer


Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.imgEditInfoArrow.Visible = False
Me.imgReceiptsArrow.Visible = False
Me.imgSearchInfoArrow.Visible = False
Me.imgUpdateInformationArrow.Visible = False
Me.imgReportsArrow.Visible = False
End Sub


Private Sub Form_Load()
DoCmd.MoveSize , 2500
Me.TimerInterval = 1
start = 1
End Sub


Private Sub Form_Timer()



Dim hv As Integer
Dim adh As Integer

Me.txtDigitalClock = Time
Me.Ahours = Format(Time, "hh")
Me.Amin = Format(Time, "nn")
Me.Asec = Format(Time, "ss")

If Me.Amin >= 12 And Me.Amin <= 23 Then
adh = 1
ElseIf Me.Amin >= 24 And Me.Amin <= 35 Then
adh = 2
ElseIf Me.Amin >= 36 And Me.Amin <= 47 Then
adh = 3
ElseIf Me.Amin >= 48 And Me.Amin <= 59 Then
adh = 4
End If


hv = IIf(Me.Ahours = 12, 0, IIf(Me.Ahours > 12, Me.Ahours - 12, Me.Ahours)) * 5 + adh

Dim ctrl2 As Control
For Each ctrl2 In Controls

If Left(ctrl2.Name, 1) = "h" Then

If Right(ctrl2.Name, 2) = hv Then
Me(ctrl2.Name).Visible = True
Else
Me(ctrl2.Name).Visible = False
End If

End If

Next




Dim ctrl As Control
For Each ctrl In Controls
If Left(ctrl.Name, 1) = "s" Then

If Right(ctrl.Name, 2) = Me.Asec Then
Me(ctrl.Name).Visible = True
Else
Me(ctrl.Name).Visible = False
End If

End If

Next


Dim ctrl3 As Control
For Each ctrl3 In Controls
If Left(ctrl3.Name, 1) = "m" Then

If Right(ctrl3.Name, 2) = Me.Amin Then
Me(ctrl3.Name).Visible = True
Else
Me(ctrl3.Name).Visible = False
End If

End If

Next


If start = 1 Then
Me.Clock.SetFocus
start = 2
End If


End Sub

Private Sub imgExit_Click()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Are you sure you want to exit?"
Style = vbYesNo + vbExclamation + vbDefaultButton2
Title = "Exit MINIMALIST"
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then
    MyString = "Yes"
    DoCmd.Quit
Else
    MyString = "No"
End If
End Sub


Private Sub lbl_M_INIMALIST_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.imgEditInfoArrow.Visible = False
Me.imgReceiptsArrow.Visible = False
Me.imgSearchInfoArrow.Visible = False
Me.imgUpdateInformationArrow.Visible = False
Me.imgReportsArrow.Visible = False
End Sub


Private Sub lblM_I_NIMALIST_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.imgEditInfoArrow.Visible = True
Me.imgReceiptsArrow.Visible = False
Me.imgSearchInfoArrow.Visible = False
Me.imgUpdateInformationArrow.Visible = False
Me.imgReportsArrow.Visible = False
End Sub


Private Sub lblMI_N_IMALIST_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.imgUpdateInformationArrow.Visible = True
Me.imgEditInfoArrow.Visible = False
Me.imgReceiptsArrow.Visible = False
Me.imgSearchInfoArrow.Visible = False
Me.imgReportsArrow.Visible = False

End Sub

Private Sub lblMIN_I_MALIST_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.imgEditInfoArrow.Visible = False
Me.imgReceiptsArrow.Visible = False
Me.imgSearchInfoArrow.Visible = False
Me.imgUpdateInformationArrow.Visible = False
Me.imgReportsArrow.Visible = False

End Sub

Private Sub lblMINI_M_ALIST_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.imgReportsArrow.Visible = True
Me.imgEditInfoArrow.Visible = False
Me.imgReceiptsArrow.Visible = False
Me.imgSearchInfoArrow.Visible = False
Me.imgUpdateInformationArrow.Visible = False

End Sub

Private Sub lblMINIM_A_LIST_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.imgEditInfoArrow.Visible = False
Me.imgReceiptsArrow.Visible = False
Me.imgSearchInfoArrow.Visible = False
Me.imgUpdateInformationArrow.Visible = False
Me.imgReportsArrow.Visible = False

End Sub

Private Sub lblMINIMA_L_IST_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
imgSearchInfoArrow.Visible = True
Me.imgEditInfoArrow.Visible = False
Me.imgReceiptsArrow.Visible = False
Me.imgUpdateInformationArrow.Visible = False
Me.imgReportsArrow.Visible = False

End Sub

Private Sub lblMINIMAL_I_ST_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.imgEditInfoArrow.Visible = False
Me.imgReceiptsArrow.Visible = False
Me.imgSearchInfoArrow.Visible = False
Me.imgUpdateInformationArrow.Visible = False
Me.imgReportsArrow.Visible = False

End Sub

Private Sub lblMINIMALI_S_T_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.imgReceiptsArrow.Visible = True
Me.imgEditInfoArrow.Visible = False
Me.imgSearchInfoArrow.Visible = False
Me.imgUpdateInformationArrow.Visible = False
Me.imgReportsArrow.Visible = False

End Sub

Private Sub lblMINIMALIS_T__MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.imgEditInfoArrow.Visible = False
Me.imgReceiptsArrow.Visible = False
Me.imgSearchInfoArrow.Visible = False
Me.imgUpdateInformationArrow.Visible = False
Me.imgReportsArrow.Visible = False

End Sub
 

JHB

Have been here a while
Local time
Today, 10:49
Joined
Jun 17, 2012
Messages
7,732
If it has worked before, then try "Compact & Repair" the database.
 

stephaniechongg

Registered User.
Local time
Today, 16:49
Joined
Feb 5, 2016
Messages
15
Thank you so much for your help :))))))
 

JHB

Have been here a while
Local time
Today, 10:49
Joined
Jun 17, 2012
Messages
7,732
Did you get the problem solved?
 

constableparks

Registered User.
Local time
Today, 03:49
Joined
Jul 6, 2017
Messages
53
In case someone else runs into this... I had the same error with a subform. Code worked before - now, getting the error mentioned above. I solved it by first decompiling the database in a command prompt:

Code:
 "C:\Program Files (x86)\Microsoft Office\root\Office16\MSACCESS.EXE" "C:\ThePathToMyFrontEnd\MyDatabase.accdb" /decompile

and then doing a "Compact & Repair" within Access. Now everything works.
 

isladogs

MVP / VIP
Local time
Today, 09:49
Joined
Jan 14, 2017
Messages
18,211
After decompiling, you should first RECOMPILE then compact & repair.
 

Users who are viewing this thread

Top Bottom