Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Type mismatch (Error 13)

    Dear All,

    I have a reoccurring problem with my Access 2000 database I have not installed any service releases.

    I posted a problem earlier "Slow Form?" [Post#: 10628 ]

    Bart replied Try the following:
    Make a new, blank database.

    This worked lovely, the de###### kicked back in and I was able to correct some obvious errors.

    HOWEVER!

    I have a strange head-aching error.

    I have isolated the troublesome code in a new DB as suggested. I am still getting an error report and I

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Type mismatch (Error 13)

    The type mismatch needs to be pinned down a little further. Try changing to this:

    Dim dbs As DAO.Database
    Dim rstconVat As DAO.Recordset

    and then:

    Set rstconVat = dbs.OpenRecordset("SELECT conVat FROM tbl_conVat", dbOpenSnapshot)

    and see if that makes a difference in which line gets highlighted. Access 2000 also seems to need a specific cursortype more than 97 did. But if you have both an ADO and a DAO reference set and you don't specify the object model in the Dim statement, you will get funny behavior like this because both object models have a recordset object but its methods and properties are different.
    Charlotte

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Type mismatch (Error 13)

    Dear Charlotte,

    Thanks for your reply.
    First of all, I

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    352
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Type mismatch (Error 13)

    Could it be a problem because you are using the variable dbs for two different databases, once in this code and once in the code for the switchboard?
    David Grugeon
    Brisbane Australia

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Type mismatch (Error 13)

    I thought you were assigning the returned value to a variable. Are you trying to return the value from this function? If so the line should read:

    <pre> getconVat=rstconVat.Fields(0)</pre>


    Otherwise, it may be recursing and calling itself over and over again. You also need to add lines to destroy the recordset and database variables at the end of the routine.

    Set rstconVat = Nothing
    Set dbs = Nothing
    Charlotte

  6. #6
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Type mismatch (Error 13)

    Dear Charlotte,
    You are right I was assigning the returned value to a variable. I realized that I should return the value to the function and changed it. Not a good idea to move the goal posts half way through, and definitely not polite. Please accept my apologies.

    It works a treat now thank you. I was convinced that it was a problem with Access and this threw me.

    Rupert

Posting Permissions

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