Results 1 to 11 of 11
  1. #1
    mastromb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Plymouth, MN
    Posts
    37

    Error: "User-defined type not defined"

    When any of the Event Procedure for my frmAPDetails tries to execute I get an error stating "User-defined type not defined" and I can not figure out how to fix it. Ironically I got the same error when I tried to convert an embedded macro that was working in a differnt form to code using the "Convert Form's Macros to Visual Basic" button on the ribbon. I have attached pdf's of the error message and code if it is at all helpful. Please help me with what I am overlooking.



    Big Disclaimer!!!
    VBA code is still greek to me. I am beginning to be able to follow the logic of a routine and re-engineer a routine to do a similar task if I have a working example that I can copy. But these attached routines are obviously not my own, they are from the Northwinds 2007 template, and it is very possible that there is a simple spelling error or inappropriate reference that has been made through my editing.

  2. #2
    mastromb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Plymouth, MN
    Posts
    37
    Below is a link to a what I thought was going to be a solution to this problem.

    http://www.techonthenet.com/access/q.../db_object.php

    Unfortunately, after following the instruction I got a VBA error message that said "Name conflicts with existing module, project, or object library"

    I'll keep trying to resolve this issue but if anyone has any ideas let me know.

  3. #3
    mastromb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Plymouth, MN
    Posts
    37
    Sorry to beg but anyone have any ideas how to fix this this error? I have taken this code down to the very basics and still get the same error.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I assume your db is in a Trusted Location. Have you tried importing everything into a new empty db?

  5. #5
    mastromb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Plymouth, MN
    Posts
    37
    Unfortunately the import did not work. This problem seems to be isolated to this form and if I remember right this is the form that I tried the Convert Macro to code thing on. I guess my next step is to try and recreate the form from the ground up and see if I can resolve the issue unless someone else has any other ideas.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Do you have any bogus MISSING References?

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    There are pictures for that as well.
    http://www.btabdevelopment.com/main/...1/Default.aspx

  8. #8
    mastromb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Plymouth, MN
    Posts
    37
    I don't think so but I guess I am not exactly sure what you mean by "BOGUS" references. What I did try though is erasing all of the code except for one simple routine that I thought for sure would work and again I got the same error message. I have a feeling there is some obscure setting that got changed through the convert macro to code button but I don't even know what I might be looking for.

  9. #9
    mastromb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Plymouth, MN
    Posts
    37
    Nope no missing references.

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How complicated is the form? Make a new one from scratch one choice. Sometimes the undocumented SaveAsText/LoadFromText sequence can fix these type of issues.

    Application.SaveAsText acForm, "ObjectNameHere", "C:\Temp\Macro.txt"
    Then use the Application.LoadFromText method to import the text file into your db.
    Application.LoadFromText acForm, "ObjectNameHere", "C:\Temp\Table.txt"


    How about a /decompile?

  11. #11
    c_smithwick is offline Underpaid Programmer
    Windows 7 Access 2003
    Join Date
    Jan 2010
    Location
    Lakeside, CA
    Posts
    49

    Check your forms and class modules

    Since you are getting the " "Name conflicts with existing module, project, or object library" error, it could be that you have public functions with the same name in more than one module. If your code (converted from macro) is in a regular module and not a form module, make sure it is not duplicated for any reason in the form module. If this is the case, go to the properties dialog in form design mode and make sure the "has module" property is no. This will delete any code in the associated form module.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to add user-defined ribbon in access 2007
    By ali-gagi in forum Access
    Replies: 1
    Last Post: 07-02-2009, 07:01 AM
  2. aSTR = Dir("C:\*.*") >> "Type Mismatch"
    By JGrant in forum Programming
    Replies: 1
    Last Post: 03-28-2009, 05:17 AM
  3. Replies: 23
    Last Post: 03-26-2009, 06:50 PM
  4. Possible to store user-defined types in table?
    By Binky in forum Programming
    Replies: 0
    Last Post: 11-20-2008, 02:28 PM
  5. "Type Mismatch" Error
    By elmousa68 in forum Access
    Replies: 2
    Last Post: 12-05-2006, 08:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums