• Creating child table entries from a string search (2k)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Creating child table entries from a string search (2k)

    Author
    Topic
    #401307

    I have a large text / memo field with a regular pattern of data in it – a set of code in blocks of 4 or 10.

    I just need to know whether it is possible to examine that field, parse it into its set of individual codes, and write each of these to a separate line in a child table. Woild this be Access functions, or would VBA be involved?

    High level answer would help me map out the direction I want to go

    Thanks

    Mike C

    Viewing 2 reply threads
    Author
    Replies
    • #789744

      Mike,

      Perhaps someone else can figure out how to do it with “Access Function”, but not I. On the other hand, it is a fairly straight forward process using VBA. The “InStr()” function would be a quick method of locating the codes, and their positions within the overall text/memo field.

      — Jim

    • #789859

      Access 2000 provides the Split() function which can be used to quickly parse a string into a single dimensional array. If you don’t pass Split a delimiter, it assumes the delimiter is a space. You can then work with the result as you would any other array. If the “codes” are individual characters with a space between blocks of characters, then split would be far faster than using Instr over and over. However, to get at each individual block of characters in the array, you have to use VBA, so there isn’t any simple non-VBA solution for this.

    • #789860

      Access 2000 provides the Split() function which can be used to quickly parse a string into a single dimensional array. If you don’t pass Split a delimiter, it assumes the delimiter is a space. You can then work with the result as you would any other array. If the “codes” are individual characters with a space between blocks of characters, then split would be far faster than using Instr over and over. However, to get at each individual block of characters in the array, you have to use VBA, so there isn’t any simple non-VBA solution for this.

    Viewing 2 reply threads
    Reply To: Creating child table entries from a string search (2k)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: