Error: Sub or Function not defined

Tanya

Access Novice
Local time
Today, 12:33
Joined
Sep 7, 2008
Messages
165
Hi I hope someone can help me, I have no idea what is wrong with this code:

Note: studentID_DblClick is on a subform of frmClasses named subfrmMakeClasses

Private Sub StudentID_DblClick(Cancel As Integer)
ViewStudents
End Sub
Private Sub ViewStudents()
On Error GoTo Err_ViewStudents
If IsNull(Forms![frmClasses]![ClassID]) Then
MsgBox "Enter class information before opening assignments form."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "frmStudents"
End If
Exit_ViewStudents:
Exit Sub
Err_ViewStudents:
MsgBox Err.Description
Resume Exit_ViewStudents
End Sub

The error occurs when frmstudents is activated and stops at IsLoaded
Here is the code for frmstudents:

Private Sub Form_Load()
If Me.OpenArgs = "GotoNew" And Not IsNull(Me![StudentID]) Then
DoCmd.DoMenuItem acFormBar, 3, 0, , acMenuVer70
End If
End Sub
Private Sub Form_Activate()
On Error GoTo Err_Form_Activate
If IsLoaded("frmClasses") Then <<<<<This is where it stops :(
If Forms![frmClasses]![subfrmMakeClasses].Form.RecordsetClone.RecordCount > 0 Then
Me.Requery
DoCmd.GoToControl "StudentID"
If IsNull(Forms![frmClasses]![subfrmMakeClasses].Form![StudentID]) Then
DoCmd.DoMenuItem acFormBar, 3, 0, , 70
Else
DoCmd.FindRecord Forms![frmClasses]![subfrmMakeClasses].Form![StudentID]
End If
End If
End If
Exit_Form_Activate:
Exit Sub
Err_Form_Activate:
MsgBox Err.Description
Resume Exit_Form_Activate
End Sub


Thanks
Tanya
 
i take it you have a function called IsLoaded? this is not built in, exactly.
 
Thank you wazz
I was following an example from a database template from the microsoft site and didn't understand I was trying to call a function.
I have now found the function in a module called global code.
Thanks heaps.

Tanya
 

Users who are viewing this thread

Back
Top Bottom