Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239

    Question Unanswered: Run-time error '13'

    What am I doing wrong ?
    In the following code I get the following message after the last 'Set' statement:

    Run-time error '13'
    Type mismatch


    Function GetPicture ()
    Dim db As Database, TempTable As Recordset

    Set db = DBEngine.Workspaces(0).Databases(0)
    Set TempTable = db.OpenRecordset("tl-Equipment_Pictures_Temp")
    ....
    ....
    Exit function




    thanks for any proposal
    Sincerely Vestigo

  2. #2
    Join Date
    Nov 2003
    Location
    Sussex, England
    Posts
    404

    Type mismatch

    This may not help, but you could try setting the db to current, e.g.

    Set db=CurrentDB

    I can't think of anything else without knowing more about your database structure - although I don't like that ' - ' in your table name, I'd prefer an underscore ' _ ' like you have elsewhere.

    Good luck.

  3. #3
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239
    What I'm trying to do has always functioned before. But after I put in "Option Explicite" in my module, the error message occure. (but it does not help to remove "Option Explicite"

    By the way, are there any problem by using "-" in table names?

    sincerely
    Vestigo

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Yes, try to change the name of your table, removing the - sign. Once I had such problem.

  5. #5
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239

    Red face Remove "As Recordset"

    %##&*

    By removing "As Recordset" in decleration it function again.
    ??!!

    Sincerely Vestigo

    Function GetPicture ()
    Dim db As Database, TempTable ' As Recordset

    Set db = DBEngine.Workspaces(0).Databases(0)
    Set TempTable = db.OpenRecordset("tl-Equipment_Pictures_Temp")
    ....
    ....
    Exit function

  6. #6
    Join Date
    Nov 2003
    Location
    Sussex, England
    Posts
    404
    If it works don't knock it, but I'd be curious to know why a recordset is the wrong type to set to a recordset!!

    On the other hand anything that works is good!


Posting Permissions

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