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

    Accepting a list of strings in a textbox from a datamatrix barcode and assigning them to an array

    Hi Everyone,

    I have a scanned datamatrix barcode that has the following 3 strings accepted into a text box:

    After scanning the DM barcode, my text box contents are as follows:

    (K)GMSR841
    (1T)8322E32890
    (2Q)17000

    I intended to accept these 3 lines into 3 different variables using an array.

    My code declares an array as follows:
    Dim arr(2)


    and accepts the text box input into my array thus:
    Dim KValue,1TValue, 2QValue
    KValue=arr(0)


    1TValue = arr(1)
    2QValue=arr(2)

    However, this results in a data type mismatch. How do I overcome this? any suggestions are welcome
    If there is another way, that I can use to manipulate DM barcode data, I am open to using those suggestions too.

    Regards,
    Rick

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Can you post a copy of your database as a zip file? remove anything private/confidential first
    I have no experience with the bar code scanner.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Data from barcode has 3 parts separate by what - linefeed?

    Not showing code that populates array.

    Access VBA should reject variable names beginning with number.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    kamathmanoj is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2019
    Posts
    41
    I found a way around this hurdle by using split with the following code:

    Dim cValue
    cValue = Split(Me.Text0.Value, vbCrLf)
    MSGBOX(cValue(0))

    ..
    ..
    ..

    It works!

    Thanks for hearing me out.

    Regards,
    Rick

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

Similar Threads

  1. Replies: 2
    Last Post: 11-10-2017, 04:38 AM
  2. Assigning textbox value through vb
    By cbende2 in forum Access
    Replies: 8
    Last Post: 06-02-2015, 12:34 PM
  3. Set TextBox To Take Array Value
    By Juan4412 in forum Forms
    Replies: 3
    Last Post: 03-09-2015, 12:31 PM
  4. Replies: 3
    Last Post: 07-25-2013, 05:19 PM
  5. DataMatrix Barcode Font Not Printing
    By waltb in forum Reports
    Replies: 3
    Last Post: 10-12-2012, 05:42 AM

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