Results 1 to 10 of 10
  1. #1
    kamathmanoj is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2019
    Posts
    41

    Unhappy Amazing Issue with Access Form

    Hello Everyone,

    I have an Access database that is currently being rejigged to have scanning capabilities. The first phase is simple.


    Form 1: Scan your ID >> Looks up your name, user confirms it is them (Ok/Cancel) takes them to Form 2
    Click image for larger version. 

Name:	Login Form.PNG 
Views:	33 
Size:	3.8 KB 
ID:	39266



    Form 2: Task List >> Click a radio button and your are taken to either enter the raw material OR enter actual observations
    Click image for larger version. 

Name:	Task List.PNG 
Views:	32 
Size:	12.5 KB 
ID:	39267


    Form 3 Tab1 : Enter Raw Material data >> Click New command button
    Click the job tab (second tab from the left)

    Click image for larger version. 

Name:	Info Tab.PNG 
Views:	32 
Size:	18.7 KB 
ID:	39268

    Scan the data matrix bar code into the obvious field in the screen capture below, function on update(), splits the array it receives into different text boxes tied to the recordset and saves it.
    I have added the Exit Sub for Exit and Error handling.

    Click image for larger version. 

Name:	Coil Details.PNG 
Views:	32 
Size:	13.4 KB 
ID:	39269


    When I scan the exact same code on the same database form, it goes through but twice now, my users are seeing the scan(!!) from the Coil tab go into the VBA code in the background.
    I cannot replicate this error no matter what I type for the array fields. Every error I can think of is caught by VBA and shown as a dialog box. Can someone think how the user might be bypassing all of this and ending up with the scan inside the code? See the picture of where the scan is ending up below:

    Click image for larger version. 

Name:	CB394723 (002).jpg 
Views:	32 
Size:	213.4 KB 
ID:	39270
    Last edited by kamathmanoj; 08-01-2019 at 12:56 PM. Reason: Accidental Disclosure

  2. #2
    kamathmanoj is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2019
    Posts
    41
    This is list of the barcode and what is going into the array in sequential order:
    (P)C22J153AA/54
    (V)SDI
    (S)1602813901
    (K)378155
    (1T)B908571
    (2Q)31780
    (1Q)1095
    (Q)1
    (ZC).06
    (ZMN).51
    (ZP).011
    (ZS).004
    (ZSI).004
    (ZAL).02
    (T)66.6
    (Y)52.6
    (E)32
    (W)53.2300
    (G).1574

    If you look at the scanner, which is running an RDP session to the PC that MS Access is open on, notice how the sequence of the entry is changed too and "(" goes missing in the last 4 lines of the scan. It boggles my mind. Please help.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    Can someone think how the user might be bypassing all of this and ending up with the scan inside the code? See the picture of where the scan is ending up below:
    I don't have a solution, but I have seen it happen when using things like keypress events/timers and/or code errors which open the vba window and the vba window is then receiving the input.

  4. #4
    kamathmanoj is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2019
    Posts
    41

    Unhappy

    Quote Originally Posted by Ajax View Post
    I don't have a solution, but I have seen it happen when using things like keypress events/timers and/or code errors which open the vba window and the vba window is then receiving the input.
    I agree, it might happen with multiple scanner button presses, but when the text box is active and the afterupdate event is programmed, what are the chances that a single trigger press, splits part of the scan into the text box, and the remaining into the code? If there was an error in the scan, I have a handler that exits the function. There are no timers set nor keypress events and neither is there a code error that is being seen (which would result in the VBA flashing a "End/Debug/Exit" dialog box, no?

  5. #5
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Does your error handler have a generic response for any error that you have not foreseen? If so, are they tripping it and are you logging the error number, description and as many of the variables as possible? This may be a permissions issue or an unanticipated user approach, either of which might cause a variable to be null or empty. I say that because it appears as though you're saying it happens to others but not to you. Secondary might be your break option in the vbe editor, such as "break on all errors" rather than just unhandled ones.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    such as "break on all errors" rather than just unhandled ones.
    good point - I've been caught out with that in the past

  7. #7
    kamathmanoj is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2019
    Posts
    41
    Thats sensible, I have the error capture - its Error 9, subscript out of range. And I found out something new today. I am onsite. I find that when I scan to a notepad instance and then paste the output into the text box, it works fine but when I scan to the field, its giving me a subscript out of range error. Ideas?

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    its giving me a subscript out of range error. Ideas?
    none that spring to mind. The error normally relates to arrays/collections/dictionaries

    https://docs.microsoft.com/en-us/off...-range-error-9

  9. #9
    kamathmanoj is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2019
    Posts
    41

    Wink

    Quote Originally Posted by Ajax View Post
    none that spring to mind. The error normally relates to arrays/collections/dictionaries

    https://docs.microsoft.com/en-us/off...-range-error-9

    Thank you Ajax. Indeed it was! The company adding the bar code, added a Horizontal Tab at the end of the expected string causing the Access data to flow in as multiple strings. I contacted the scanner technical support to check if we could do something to remove it but given that these were not part of the initial work-flow, we have asked the bar coder to remove the <Horizontal Tabs>. It works fine now. Wonder what they will cook up next! LOL

  10. #10
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    glad you got it sorted

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

Similar Threads

  1. Printing issue form a form (MS Access 2010)
    By gutenberg in forum Forms
    Replies: 7
    Last Post: 06-23-2016, 12:47 PM
  2. Access 2007 form count issue
    By fspata in forum Forms
    Replies: 3
    Last Post: 10-03-2015, 01:51 PM
  3. Access Sub form issue
    By djspod in forum Forms
    Replies: 6
    Last Post: 06-22-2015, 11:16 AM
  4. Replies: 3
    Last Post: 03-17-2014, 10:23 AM
  5. The amazing disappearing VBA code
    By Michele Keck in forum Forms
    Replies: 2
    Last Post: 10-01-2010, 11:44 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
  •  
Other Forums: Microsoft Office Forums