try also to replace
DoCmd.Close A_FORM, "Complete Class"
with
DoCmd.Close acFORM, "Complete Class"
--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com
"Andrew Gould" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I just recently converted a database from A97 to A2K2. I keep getting the
> error, "User-defined type not defined". I've check the references and the
> old database when opened in 97 lists:
>
> -VBA
> -MSAccess 8.0 Object Library
> -Microsoft DAO 2.5/3.5 Compatibility Library
> -utility
> After importing all tables, forms, ect into an A2K2 new database I
attempted
> to match the references as close as possible to:
>
> -VBA
> -MSAccess 10.0 Object Library
> -MS DAO 3.6 Object Library
> I'm still getting that same error all over the place. I looked at the
code
> and it looked a little old but wasn't for sure. Here is the part of the
> code that keeps giving me problems, can someone please tell me if the code
> needs to be redone or is it something else.
>
> On Error GoTo Err_Complete_Class
> Dim db As Database
> Dim History As Table
> Dim Class As Snapshot
> Dim CCount As Control
> Dim TotEnroll As Control
> Set TotEnroll = Me![*Complete Class].Form![Total Enrolled]
> Set CCount = Forms![Complete Class]![Class Counter]
> Set db = CurrentDb()
> Set Class = db.CreateSnapshot("Class Schedule")
> Set History = db.OpenTable("Class History")
>
> If Me![Status] <> 0 Then
> MsgBox "This Class Has Already Been Closed Or Canceled.", 0, "ADP
> Continuing Education"
> Else
>
> Class.FindFirst "[Class Counter] = " & CCount
>
> For I = 1 To TotEnroll
> History.AddNew
> History("Date") = Me![Date 1]
> History("Student ID") = Class("Student ID")
> History("Class ID") = Me![Class ID]
> History("Instructor") = Me![Instructor]
> History("Blue Tag") = Class("Blue Tag")
> History.Update
> Class.FindNext "[Class Counter] = " & CCount
> Next
> Me![Status] = 1
> History.Close
> DoCmd.Close A_FORM, "Complete Class"
> End If
>
>