Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    New Lounger
    Join Date
    Jan 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access v2 to 2000 (2000)

    Hi,

    I've read back in the posts & couldn't find anything. I am trying to convert a database from v2 to 2K. When I convert it, I get the following message: There were compilation errors during the conversion or enabling of this database. The database has not been saved in a compiled state. etc. So I go into the Visual Basic editor to recompile and I get this error: Compile error user-defined type not defined. It highlights the line mytable As Table. Now note, I didn't create this database, and I'm pretty much a newbie in the designing of a database. I'd really like to update this database and any info would be greatly appreciated.

    thanks

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Access v2 to 2000 (2000)

    You wrote:
    >>It highlights the line mytable As Table.<<

    You will really have to provide more than this snippet of code. "mytable as Table" doesn't even appear to be a complete line, but rather a part of a line.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    New Lounger
    Join Date
    Jan 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access v2 to 2000 (2000)

    This is the code that it goes to. Here is the whole little section. Just to let you know, this is a rankings program, to tabulate the top Dobermans in Canada. I enter all the show information, and it is supposed to tabulate the top dogs from the points rec'd.

    Function bbjudge()
    Dim MyDB As Database
    Dim mytable As Table
    Set MyDB = OpenDatabase("C:CSSRankings.mdb")
    Set mytable = MyDB.OpenTable("Judges") ' Open table.
    mytable.Index = "Judge's name" ' Set index.

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Access v2 to 2000 (2000)

    Dim mytable As Table
    Set MyDB = OpenDatabase("C:CSSRankings.mdb")
    Set mytable = MyDB.OpenTable("Judges") ' Open table.
    mytable.Index = "Judge's name" ' Set index.

    Your problem is with obsolete code. Access97 might have allowed it for backward compatibility, but apparently it was discontinued with Access2000. Instead of "As Table", use "As DAO.Recordset". And instead of ".OpenTable" using ".OpenRecordset". Make sure you have the DAO library checked in your reference list.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    New Lounger
    Join Date
    Jan 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access v2 to 2000 (2000)

    Thanks, I'll try that and see if that works

  6. #6
    New Lounger
    Join Date
    Jan 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access v2 to 2000 (2000)

    Hi,
    OK, got that part working at least so far. Now, I get the error Run-time error '2450'. Microsoft Access can't find the form "MASTER' referred to in a macro expression or Visual Basic code. Here is a clip of the code it is referring to.
    If CHECKYEAR = 1993 Then
    Forms![MASTER]![DATE1] = #12/31/1993#
    Forms![MASTER]![DATE2] = #1/1/1993#
    End If
    If CHECKYEAR = 1994 Then
    Forms![MASTER]![DATE1] = #12/31/1994#
    Forms![MASTER]![DATE2] = #1/1/1994#
    End If

    There is one of these for each year from 93 to 2004, is there any way to put it in one simple code? Mind you I don't know anything about VB or VBA.

    thanks

    Lee

  7. #7
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Access v2 to 2000 (2000)

    Well, it appears there is no form named Master! Check your database window and look for a form named Master. If you can't find it, then you got a problem.

    And yes, there are ways to simplify the code, but it requires some knowledge of VBA. I'd leave what you have alone for now until after you have a successful conversion. Only then should you consider making improvement.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  8. #8
    New Lounger
    Join Date
    Jan 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access v2 to 2000 (2000)

    Yes, there is a form named Master. It has the following info in it. Breed, Compiled by, breed1, DATE1, DATE2. I think it links to the table with the same name and fields

  9. #9
    New Lounger
    Join Date
    Nov 2001
    Location
    Twickenham, UK
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access v2 to 2000 (2000)

    Is the form 'Master' open when you're running the bit of code?

  10. #10
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Access v2 to 2000 (2000)

    I reread your post. I thought you were getting a compile error, but I see you were getting a runtime error. This means that Master isn't actually open when you run the code. Only open forms (but not subforms) are listed in the Forms collection.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  11. #11
    New Lounger
    Join Date
    Jan 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access v2 to 2000 (2000)

    Hi,

    Thanks for all the help. Yes, master was closed when I was trying to run the code. I got out of the program and went back in and it ran fine. I had to do some adjustments with the reports and think I have those fixed. I'm only stumped on one more problem. In the reports, there is a text box, it has the following in it.
    ="Compiled By |[Forms]![master]![compiled by]| as of |Date()|" now I'm assuming that this coding doesn't work in 2000, I'm trying to figure out which parts. I've tried different things via the Expression Builder but can't get it right. I know it's supposed to give the following in the text box. Compiled by Lee Hartfield as of Jan 14, 2002, getting the name and date from that line of code, just not sure what the proper way is to do it. All the info should come from the info in the form Master. If I get this one, done, then I think I have successfully converted it. And I thank you greatly for all your help. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  12. #12
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Access v2 to 2000 (2000)

    Hi,
    Try:
    ="Compiled By " & [Forms]![master]![compiled by] & " as of " & Date()
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  13. #13
    New Lounger
    Join Date
    Nov 2001
    Location
    Twickenham, UK
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access v2 to 2000 (2000)

    Try something like

    ="Compiled By " & [Forms]![master]![compiled by] & " as of " & Date()

    assuming that the field 'compiled by' is on your form 'Master' and the form is open.

  14. #14
    New Lounger
    Join Date
    Jan 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access v2 to 2000 (2000)

    That was it <img src=/S/fanfare.gif border=0 alt=fanfare width=31 height=23>. Now to just figure out why my lines disappeared in one of my reports and I'm done.
    Thank you all for your help, it was very much appreciated. Now to save this, so I can use it, and make a copy of it so I can play with adding additional features.

  15. #15
    New Lounger
    Join Date
    Jan 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access v2 to 2000 (2000)

    Ok, I lied I have one more that I can't figure out. Again it's old code trying to go to new code. Here is the line.
    ="[class males] - [class females] - [specials male] - [specials female]"
    I've tried moving the " to around the - instead, but no luck.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •