+ Reply to Thread
Results 1 to 6 of 6

is there any way to query table to put every word alone ?

  1. #1
    Registered User
    Join Date
    10-03-2009
    Location
    cairo
    MS-Off Ver
    Excel 2003
    Posts
    33

    is there any way to query table to put every word alone ?

    hi all,
    i have table with a memo column , i want to build query to divide all the text in the column to many column .
    exactly like the option in excel which called
    text to column .
    kind regards
    sherif

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: is there any way to query table to put every word alone ?

    Hi sherif,

    Look at the attached that will do what I think you are looking for.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    10-03-2009
    Location
    cairo
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: is there any way to query table to put every word alone ?

    thanks marvinp
    i know how to do it in excel , but i am wondering if that possible in access ?
    thanks again

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: is there any way to query table to put every word alone ?

    Sorry, I didn't see the Access part of the title.

    In Access you need to define each field in the table before filling them in. In your question it seems you don't know how many words there will be in the Memo field, or how many fields/columns to define in the beginning. It seems an easier problem would be to make each word it's own record in a table, but that isn't what I think you now want.

    I'd be looking for an index number of each field in each record of the Access table. Then you could increment the index and go to the next field to put the memo words in.

  5. #5
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: is there any way to query table to put every word alone ?

    The easiest way to do this is to export the table to Excel, us the text to columns feature, then import back into access.

    If you absolutely have to do it all in Access, as MarvinP said, you'll need a way to find the max number of words to set up your table. You need to open your original table as a recordset, then loop through each record. You can use a function like this to find the number of spaces. The highest word count should be the number of spaces + 1.

    Spaces = Ubound(Split(strRecord," "))

    Hope that helps.
    Last edited by davegugg; 11-08-2011 at 11:20 AM.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  6. #6
    Registered User
    Join Date
    10-03-2009
    Location
    cairo
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: is there any way to query table to put every word alone ?

    thank you so much dave

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1