S
shelly2 via AccessMonster.com
I've got an Access 2003 database that is used on both a 2K Pro machine and an
XP Pro machine. Everything was fine until I tried to call a public sub in
one form from another form. It works fine on the 2K machine, but gives me a
Runtime 459 error ("object or class does not support the set of events") on
the XP. It breaks on the line I've highlighted with asterisks below.
This is the code I use to call the sub, located in a form called "Punch":
*~*~*~*~*~*~*~*~*~*
DoCmd.OpenForm "Allocate Form"
***Forms![Allocate Form].PopulateInit (init)***
*~*~*~*~*~**~*~*~*~*
This is the sub on the Allocate Form:
*~*~*~*~*~*~*~*~*~*~*
Public Sub PopulateInit(init)
Dim t As Single
Me.Text4.SetFocus
Me.Text4.Text = Date
Me.MasterInit.SetFocus
Me.MasterInit.Text = init
Calendar3.Value = Date
Me.txtTotalTime.SetFocus
t = Me.txtTotalTime.Value
Me.Allocate_Subform.SetFocus
DoCmd.GoToRecord , , acFirst
x = Me.Allocate_Subform.Form.amounttime.Value
If x = 0 Then
Me.Allocate_Subform.Form.amounttime.Value = t
Me.Refresh
Else: Exit Sub
End If
End Sub
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
Thanks in advance for your assistance!
XP Pro machine. Everything was fine until I tried to call a public sub in
one form from another form. It works fine on the 2K machine, but gives me a
Runtime 459 error ("object or class does not support the set of events") on
the XP. It breaks on the line I've highlighted with asterisks below.
This is the code I use to call the sub, located in a form called "Punch":
*~*~*~*~*~*~*~*~*~*
DoCmd.OpenForm "Allocate Form"
***Forms![Allocate Form].PopulateInit (init)***
*~*~*~*~*~**~*~*~*~*
This is the sub on the Allocate Form:
*~*~*~*~*~*~*~*~*~*~*
Public Sub PopulateInit(init)
Dim t As Single
Me.Text4.SetFocus
Me.Text4.Text = Date
Me.MasterInit.SetFocus
Me.MasterInit.Text = init
Calendar3.Value = Date
Me.txtTotalTime.SetFocus
t = Me.txtTotalTime.Value
Me.Allocate_Subform.SetFocus
DoCmd.GoToRecord , , acFirst
x = Me.Allocate_Subform.Form.amounttime.Value
If x = 0 Then
Me.Allocate_Subform.Form.amounttime.Value = t
Me.Refresh
Else: Exit Sub
End If
End Sub
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
Thanks in advance for your assistance!