Results 1 to 5 of 5
  1. #1
    Upgrade Hidraulic System is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2019
    Posts
    3

    Type mismatch upon excuting a macro.


    I made a table, form and report to show me information of clients being these: name, phone, company, city etc.

    I also put a special form of identification through macro where when typing a number from 1 to 3 and depending on one of these values, a rectangle changes color . However, when I register another client, the value resets normally, but the rectangle does not . If for example I put the value 1 on the client A, the rectangle is green, on the client B the value 2, the rectangle is yellow, but when I return to client A, even with the value 1 the rectangle remains yellow and not green . I placed this macro to run whenever the form was opened / loaded / updated, but no matter where I put it, I get an error 13 of "Type Incompatible" .

    I wish someone could help me with this problem, I will send screenshots if necessary .

    Click image for larger version. 

Name:	Access Macro.png 
Views:	6 
Size:	27.5 KB 
ID:	39124Click image for larger version. 

Name:	Access Macro Passo a Passo.png 
Views:	6 
Size:	32.9 KB 
ID:	39125Click image for larger version. 

Name:	Access Report Event.png 
Views:	6 
Size:	8.2 KB 
ID:	39126
    Last edited by Upgrade Hidraulic System; 07-18-2019 at 11:44 AM. Reason: Just solved what I needed

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    A type mismatch error would imply that the data type is text, not numeric. If so, try surrounding the value (1, 2, 3) with quotes:

    If Whatever = "1"

    If this is on a form, the current event would fire when the user changes records.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I notice you marked the thread solved. Posting your solution could help users searching for solutions to similar problems. Welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Upgrade Hidraulic System is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2019
    Posts
    3
    Thanks for the reply, I'll keep this in mind if I ever encounter this error message again.

  5. #5
    Upgrade Hidraulic System is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2019
    Posts
    3
    So I fixed what was wrong, here are the images to what I have altered, why what I did took effect I'm not so sure.

    Click image for larger version. 

Name:	Access Macro FIXED.png 
Views:	6 
Size:	49.7 KB 
ID:	39128Click image for larger version. 

Name:	Access Report Event FIXED.png 
Views:	6 
Size:	6.7 KB 
ID:	39127

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

Similar Threads

  1. Type Mismatch error 13 on SetValue Macro
    By lmahere in forum Macros
    Replies: 2
    Last Post: 04-14-2016, 12:34 PM
  2. Type 13 (Type Mismatch) error
    By sdel_nevo in forum Programming
    Replies: 5
    Last Post: 01-22-2016, 10:01 AM
  3. type mismatch
    By Compufreak in forum Access
    Replies: 5
    Last Post: 08-08-2012, 11:00 AM
  4. type mismatch
    By slimjen in forum Forms
    Replies: 21
    Last Post: 07-24-2012, 03:14 PM
  5. Type mismatch in condition embedded macro
    By geremore in forum Programming
    Replies: 3
    Last Post: 08-09-2011, 02:05 PM

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
  •  
Other Forums: Microsoft Office Forums