Results 1 to 4 of 4
  1. #1
    kriptech is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Posts
    1

    Unhappy Script to extract information out of a field

    I am very new to anything Access and I am needing alot of help with creating a database. First issue is I will be scanning a QR code into a field named QR Code. Example - When you scan the QR code the text that populates into the field is: 865301030562322,HA0LDS1T,ZA2X0000US. I will need to copy the first section, 865301030562322 and populate a field called IMEI# then copy the middle section: HA0LDS1T and populate a field named Serial# and finally copy the last section: ZA2X0000US and populate a field named Part#. So as follows:
    QR Code: 865301030562322,HA0LDS1T,ZA2X0000US
    IMEI#: 865301030562322
    Serial#: HA0LDS1T
    Part#: ZA2X0000US
    I hope I explained it correctly..

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,858
    You could use the Split() function to do all that.
    http://https://support.microsoft.com...f-10078c7878f5
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    If those are the actual field names, I would suggest fixing the names first.
    Spaces and Special Characters. You may be tempted to use spaces or special characters when naming database objects. These special characters can produce errors when referring to them in queries or VBA if not handled correctly. Avoid them when naming objects in your database. The underscore “_” is a widely accepted character by many programmers. It is not recommended here, but simply acknowledged to be acceptable.
    Special characters / \ | @ £ ^ ( ) [ ] { } ; : ! # & = * + - ? " ' $ %
    See Naming Conventions

    Better would be:
    IMEI_Num
    SeriaNum
    PartNum



    Some suggestions:
    Use only letters and numbers (exception is the underscore) for object names.
    Do not use spaces, punctuation or special characters in object names.
    Do not begin an object name with a number.
    Do not use Look up FIELDS, multi-Value fields or Calculated fields in tables.

    What not to use in names

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    If there are a lot of records I don't think I would recommend splitting the data in to 3 fields because it's basically repeating the data - unless you will need to group by 1 or more of those fields or if you will need to edit it. If you're only going to look at it in reports and forms you can pass 1 of each of the 3 parts to the form/report controls. If you will want to edit or group by, then it is still possible to use the entire field but may not be worth the work.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Extract information and merge them
    By donberti in forum Queries
    Replies: 2
    Last Post: 03-10-2014, 01:09 AM
  2. Need to create a script to auto update a field
    By storyiii.5 in forum Programming
    Replies: 1
    Last Post: 08-07-2013, 04:43 PM
  3. extract something from a field
    By tozey in forum Queries
    Replies: 4
    Last Post: 02-24-2012, 08:54 AM
  4. Extract certain values from field
    By tylerg11 in forum Programming
    Replies: 19
    Last Post: 09-23-2011, 03:27 PM
  5. Replies: 10
    Last Post: 08-18-2011, 04:27 PM

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