sphere_monk
Registered User.
- Local time
- Today, 03:21
- Joined
- Nov 18, 2002
- Messages
- 62
Hi Everyone,
I have a combo box on a subform from which I call a couple Public Subs in its AfterUpdate Event. None of the following calls recognize the forms that I'm trying to pass to them. The calls are as follows:
and the first couple lines of the Public Subs themselves are:
and
The message I'm receiving when the Calls run is:
The funny thing is that I have another form set up exactly as this form (with a subform and a combo box calling the procedures from it's AfterUpdate event) and they work. If I copy the Call statements directly from that code that works into the afterupdate event of the other combo box on the other form they don't work, even if I'm passing the same form!
I'm completely lost as to why this could happen. The forms are in the same database. Could someone please help me?
I have a combo box on a subform from which I call a couple Public Subs in its AfterUpdate Event. None of the following calls recognize the forms that I'm trying to pass to them. The calls are as follows:
Call DisableFields(Forms!frmInventoryTemp)
Call EnableBasedOnType(Forms!frmInventoryTemp)
Call EnableBasedOnType(Forms!frmInventoryTemp)
and the first couple lines of the Public Subs themselves are:
Public Sub DisableFields(frm As Form)
On Error GoTo Err_DisableFields
Dim ctl As Control
Dim ctltype As String
etc.
On Error GoTo Err_DisableFields
Dim ctl As Control
Dim ctltype As String
etc.
and
Public Sub EnableBasedOnType(frm As Form)
On Error GoTo Err_EnableBasedOnType
' MsgBox ("Running EnableBasedOnType on " & frm.Name)
Dim rst As New ADODB.Recordset
Dim cnn As ADODB.Connection
Set cnn = CurrentProject.Connection
etc.
On Error GoTo Err_EnableBasedOnType
' MsgBox ("Running EnableBasedOnType on " & frm.Name)
Dim rst As New ADODB.Recordset
Dim cnn As ADODB.Connection
Set cnn = CurrentProject.Connection
etc.
The message I'm receiving when the Calls run is:
"Workorder System can't find the form "frmInventoryTemp" referred to in a macro expression or Visual Basic Code"
The funny thing is that I have another form set up exactly as this form (with a subform and a combo box calling the procedures from it's AfterUpdate event) and they work. If I copy the Call statements directly from that code that works into the afterupdate event of the other combo box on the other form they don't work, even if I'm passing the same form!
I'm completely lost as to why this could happen. The forms are in the same database. Could someone please help me?
Last edited: