Results 1 to 2 of 2
  1. #1
    rmoreno is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    Apr 2013
    Posts
    51

    Parsing Tilde Delimited Memo Field


    Hi, I need help with a table generated by some equipment we use here at work. There is a table named TestGrp which has two fields titled [ResutT] and [TestGroupParams]. What I would like is to create a table named TP_TestGrp and extract specific info from a 67 element tilde delimited memo field named TestGrp.[TestGroupParams] and put them into a created table named TP_TestGrp. This table needs to update automatically if the TestGrp table is modified. Can anyone help please.
    Attached Thumbnails Attached Thumbnails Table_TestGrup.jpg   Table_TP_TestGrp.jpg  

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Looks like the import wizard can't just use the tilde as separator value because the data are expressions. This is rotten export structure.

    I think this will require VBA procedure that opens a recordset of the source data, parses the string, then saves records to destination table. Something like:

    Dim strResultT As String
    Dim strAry As Variant
    Dim i As Integer
    Dim rsSource As DAO.Recordset
    Dim rsDest As DAO.Recordset
    strResultT = 'how will the value be obtained - reference to control on form or InputBox prompt user for input - I recommend a form
    Set rsSource = CurrentDb.OpenRecordset("SELECT * FROM TestGrp WHERE ResultT = '" & strResultT & "';")
    Set rsDest = CurrentDb.OpenRecordset("SELECT * FROM TP_TestGrp;")
    While Not rsSource.EOF
    strAry = Split(rsSource!TestGroupParams,"~")
    rsDest.AddNew
    rsDest.TP_ResultT = strResultT
    For i = 0 to 66
    rsDest.Fields("Data" & i + 1) = Mid(strAry(i), InStr(strAry(i), "=") + 1)
    Next
    rsSource.MoveNext
    Wend
    rsDest.Update

    Will there be requirement to edit existing record with the import values or will only always be new records?
    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.

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

Similar Threads

  1. Parsing field into two fields
    By Lewis in forum Queries
    Replies: 5
    Last Post: 11-14-2012, 04:22 PM
  2. Excel Import field truncation problem (to Access Memo field)
    By jhrBanker in forum Import/Export Data
    Replies: 6
    Last Post: 07-27-2012, 08:52 AM
  3. converting a Delimited field to a linked table
    By Dozza111 in forum Import/Export Data
    Replies: 6
    Last Post: 05-16-2012, 04:46 AM
  4. Replies: 14
    Last Post: 03-01-2012, 02:39 PM
  5. Parsing A Comma Delimited Field
    By AccessGeek in forum Import/Export Data
    Replies: 6
    Last Post: 02-03-2011, 01:52 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