Need some help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SSgtGlass
    New Member
    • May 2007
    • 2

    Need some help

    I am creating an inventory database where I need to import data from a text file created by a barcode scanner. The software associated with the scanner saves scanner data as a text file that looks something like this:

    1234561235
    12335
    12365
    45645
    1234567895
    12398
    45659
    4567890123
    12397

    The 10 digit codes are the barcodes for the location where the equipment is. The following 5 digit codes are the barcodes of the equipment in the location scanned above.
    I would like to set up an import parent child relationship so that the equipment is associated with the location. I have limited access/coding experience but I pick things up quickly. I realize this could get complicated, quick.
    Let me know if you guys have any ideas.

    Much thanks,
    SSgt Jonathan Glass
    USAF
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    This question has been posted in the articles section. I am moving it to the Access forum.

    ADMIN

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32662

      #3
      As the data for the two tables is stored together, but on separate lines, this will not be too straightforward . The only way that I can see to handle this would be :
      1. Define an import table (tblImport) with the one (text) field but with enough characters to handle either field.
      2. Define two other tables :
        1. tblLocation - which simply has the ten char primary key (Location).
        2. tblEquipment - which has both a Location field and an Equipment field.
      3. Write some code to :
        1. Clear the current data in the tblImport table.
        2. Import the new data into tblImport.
        3. Loop through the data remembering whatever is the latest Location and writing the data to both tables where appropriate (A Location line would be written to tblLocation, but an Equipment line would be written, with the most recent Location data, to tblEquipment).

      Comment

      Working...