Results 1 to 11 of 11

Error 13 type mismatch after windows and office update

  1. #1
    kornowka is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    5

    Error 13 type mismatch after windows and office update

    Hello access users, did someone of you have similar problem and now the solution fot this case:


    After Windows & Office Update (Windows 7, Office 2016) my tool stopped working properly on some computers.
    It means that VBA macros running correctly only on the computers which was not updated yet.


    Shortly about the project


    there is 2 databes connected between each other, one of this tool was created in order to read custom information from .txt reports and count specific values
    to automatically added recordsets, based on ADO library.


    Everything works good till the moment, when macro need to count summary values for one table.
    It goes like that:




    Dim rsTable1 as New ADODB.Recordset
    Dim rsTable2 as New ADODB.Recordset


    rsTable1.Fields("SumToPay").Value = Round(rsTable2.Fields("Fee").Value +_
    (rsTable1.Fields("Amount1").Value - rsTable2.Fields("Amount2").Value * rsTable2.Fields("Amount2").Value,2)




    After Office Update MS Acces showin well-known error 13 data mismatch. At first I was thinking that there is a trobule with the reports (wrong path dedicated),


    so I repeat the process, but seems that reason must be different.


    What must be done to solve the issue? Is it possible that library is switch off?
    or maybe the math construction need to be write again or there is a on little mistake, that was not a problem for various versions of Office?

  2. #2
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    6,579
    it may well be an update issue, but at the moment your code does not make sense. You create two recordset objects, but have not assigned a recordset to either of them

    assuming there is missing code which does the assignment you could try referencing them differently

    rsTable1!SumToPay= Round(rsTable2!Fee +_ etc

    type mismatch implies trying to assign text to number or visa versa which is a data issue - perhaps one of the values is null

    with regards libraries - easy enough to check - go to tools>references - is one of them missing?

  3. #3
    kornowka is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    5
    Hi Ajax
    thanks for suggestions.

    I did check the library and everything's fine

    I used the suggested methotodology of counting (rsTable1!SumToPay= Round(rsTable2![...]) cause actually you have to options if you make an reference to existing fields/tables in VBA code
    It also wroks correctly after changes.

    But still there is the same error on one computer only, after windows updates:

    OS = WINDOWS PROFFESIONAL 7 64X
    OFFICE = 2016

    Did someone had similat situation?

  4. #4
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    6,579
    I'm out of suggestions other than is the bit of Office the same - i.e. you don't have a mix of 32bit and 64bit

    And you'll need to check but I don't think windows 7 is still being supported other than for security updates

  5. #5
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    226
    Hmm, so the first I would do is go to the table and try to enter the value into the table. Does it accept it?
    Gina Whipp
    Microsoft MVP (Access 2010-2015)
    https://www.access-diva.com/tips.html

  6. #6
    kornowka is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    5
    Ajax, thanks for answer. I think i need to focus on this issue not on a VBA code anymore

    Gina
    first step of the project is importing values to the tables from txt. reports - and it works. Second step is counting it, based on these values from the tables to one final table and here we have a problem. So, according to your propose: yes, values are still entering to the tables properly, but there is an error after MS update with the methodology of counting final values to the fields in last table.

  7. #7
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    226
    Confused? This looks to be updating a field in a table...

    rsTable1.Fields("SumToPay").Value = Round(rsTable2.Fields("Fee").Value +_
    (rsTable1.Fields("Amount1").Value - rsTable2.Fields("Amount2").Value * rsTable2.Fields("Amount2").Value,2)

    Are you value gets entered and then you get the error?
    Gina Whipp
    Microsoft MVP (Access 2010-2015)
    https://www.access-diva.com/tips.html

  8. #8
    kornowka is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    5
    Quote Originally Posted by GinaWhipp View Post

    Are you value gets entered and then you get the error?
    Don't understand this question...

    And what is your point, actually?

    As I mentioned, there is a methodolgy that works and counts values properly to one final table,but lataley there was an MS update on one of the computers and after this change I have an error in VBA code at this line:
    rsTable1.Fields("SumToPay").Value = Round(rsTable2.Fields("Fee").Value +_
    (rsTable1.Fields("Amount1").Value - rsTable2.Fields("Amount2").Value * rsTable2.Fields("Amount2").Value,2)

    or, if it is better for someone to read:


    (rsTable1!SumToPay= Round(rsTable2![...])

  9. #9
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    6,579
    @kornowka. You tell us little and then respond with unhelpful comments.

    back to basics.

    1. the datatype mismatch error speaks for itself, the strong implication is that it is a data error. Gina is asking if you have checked the values - i.e. hover over the code, or use debug.print to display on the immediate window
    2. you keep talking about counting, but the only bit of incomplete code you have provided is assigning a value - why do you think this is the problem?
    3. why did only one computer get an update?
    4. Have you tried getting the update removed?
    5. provide some example data - it may not be related but I cannot see how multiplying rsTable2.Fields("Amount2").Value by itself works for you - but perhaps this puts a number out of range and the error is misleading
    6. have you tried to import this particular text file to another machine which is 'working' - does it work then?
    7. since this is a text file, do you use an import specification?
    8. if so is it on the relevant machine - and the same as the other machines?
    9. have you tried a file you know works on another machine on this machine?
    10. how do you import? transfertext? link and query? copy/paste? another way?
    11. what do you import to? an existing table or a new/temporary table?
    12. perhaps the tool db is corrupted - have you compacted and repaired?
    13. is the tool db split?
    14. if so does each user have their own copy of the tool db front end?


  10. #10
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    226
    Oops, typing to fast, that question should read...

    Are you saying the value gets entered into the table and then you get the error?

    Note, I'm with Ajax on this, we need more details. Remember we can't see what you're doing, how you are doing it and what happens when you do it. You need to *draw* the picture for us.
    Gina Whipp
    Microsoft MVP (Access 2010-2015)
    https://www.access-diva.com/tips.html

  11. #11
    kornowka is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    5
    Hello, sorry for my late reply,
    indeed, hard to find a solution if someone sharing only 2 verses of the code. Anyway, seems that we found a reason by reinstalling Ms office. Second thing was one of report (a new one) that has different structure then the others, and it was not easy to find it cause reports are uloaded automatically to the dedicated source. Anyway thanks for your replies and suggestions.

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

Similar Threads

  1. Replies: 3
    Last Post: 08-10-2016, 10:26 AM
  2. Type 13 (Type Mismatch) error
    By sdel_nevo in forum Programming
    Replies: 5
    Last Post: 01-22-2016, 09:01 AM
  3. type mismatch after update
    By cpbittner in forum Forms
    Replies: 3
    Last Post: 03-03-2014, 10:10 PM
  4. Replies: 7
    Last Post: 07-24-2013, 01:01 PM
  5. Replies: 1
    Last Post: 05-11-2012, 09:59 AM

Tags for this Thread

Posting Permissions

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