Results 1 to 6 of 6
  1. #1
    AJC1998 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Location
    Springfield IL
    Posts
    3

    Type Mismatch/Code 39


    I have an Access Registration Database that has one table with members in it. The point of the database is to register members via barcode scanners in 2 clicks. First click of the scanner brings up the member to verify their information the second click registers them. So a member brings in their postcard and you scan their barcode twice to register them. This has worked consistantly in the past with the barcode 128. However we have someone that has used Code 39. I finally have it where it will find the member. But on the second click of the scanner it tells me there is a type mismatch. (The second click is supposed to press the Register button on the database and put the focus back on the member number box so it's ready to scan the next member's card.) I've tried this several ways. If I scan the postcard once it will find the member and then I press Enter (to Register) instead of scanning the postcard a second time the Type Mismatch error doesn't appear. What could be wrong? The numbers in the Access Table have several spaces at the end of them. I'm not familiar with Code 39 at all. If you can provide me with any ideas I'd really appreciate it! I've spent way too much time on this already! THANKS in advance!!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Type mismatch means, somewhere, the code is trying to assign a string to a number val.
    Either the scanner is moving the value to a variable or field, that is numeric only. Or the code is.

    If you can put a stop on the code after the barcode reads, then you can determine what is going where afterwards.

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    What is that "39" you are referring to? Is it an MS Access runtime error, or is it something to do with the barcode?

    Type mismatch is runtime error 13.

    The numbers in the Access Table have several spaces at the end of them.
    They won't if they are numeric data type. What do you see that makes you think there are trailing spaces? If when you open the table the data is left-justified, then it it not numeric, it is text. It only looks numeric.

    Are you able to isolate which line of code is causing the error?

  4. #4
    AJC1998 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Location
    Springfield IL
    Posts
    3
    Thanks for the responses. I'm still trying to figure this out.

    Code 39 is the type of barcode being used. I know there are several spaces because I had to add them at the end of the numbers since the actual barcode had spaces in it. It's so confusing, I know! The numbers in the Access Table are text.

  5. #5
    qa12dx is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    india
    Posts
    112
    nice q. learnt something new.

    Code39 uses 9 elements per character (5 bars and 4 spaces), that are only wide or narrow while code128 uses 6 elements per character (3 bars and 3 spaces), that have 4 variations of width.
    http://www.mobiliodevelopment.com/co...code128-usage/

    i don't think code 39 is reading more info than is on the code as u can see from the quote from the page above. the extra lines are maybe converting to special chars, which give the error.

    either ways, u might have to buy him a code 128 scanner. may be he can use both. ps2 ports just might have enough juice.
    y wire for scanner and board. get another y wire. add onto of 1st y wire and hope it works, cause sounds like he will need both...

  6. #6
    AJC1998 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Location
    Springfield IL
    Posts
    3
    I agree. I think two different barcodes are needed here. They should have just used Code 128 like I recommended and then I wouldn't be in this mess! So warning to all...Code 39 is not user friendly! Thank you all for your help and posts! I truly appreciate it.

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

Similar Threads

  1. type mismatch
    By Compufreak in forum Access
    Replies: 5
    Last Post: 08-08-2012, 11:00 AM
  2. InStr and Mid code creating type mismatch
    By sephiroth2906 in forum Programming
    Replies: 6
    Last Post: 09-15-2011, 10:59 AM
  3. Type Mismatch....WHY?!!?
    By jgelpi16 in forum Queries
    Replies: 9
    Last Post: 03-07-2011, 09:18 AM
  4. Type mismatch
    By jgelpi16 in forum Programming
    Replies: 1
    Last Post: 08-07-2010, 06:54 AM
  5. Replies: 4
    Last Post: 05-16-2009, 09:17 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