Results 1 to 12 of 12
  1. #1
    Duval is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    7

    Combined Fields as Memo


    I am combining two fields in an Access database in the following query:
    Code:
    SELECT [standard] & ":  " & [standard text] AS combinedstandard, Standards.subject, Standards.standard
    FROM Standards;
    Everything works as it should with the huge exception that it's treated as a text field and thereby limited by the 255 character count so when it's displayed on a web page it gets truncated and special characters are added at the end.

    How might I modify this query so that it would be treated as a memo field?

    TIA/Duval

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    check this out: http://allenbrowne.com/ser-63.html

    great solutions there.

  3. #3
    Duval is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    7
    Ajetrumpet, Thank you for the reference. It appears that the last of the group would be what I'd need to focus on but have no idea how to apply it in these circumstances.

    The first SELECT in a UNION query defines the field type, so you can add another UNION ALL using a Memo field so Access gets the idea. For example, instead of:
    SELECT ID, F1 & F2 AS Result FROM Table1
    UNION ALL SELECT ID, F1 & F2 AS Result FROM Table2;
    add a real memo field first (even though it returns no records), like this:
    SELECT ID, MyMemo FROM Table3 WHERE (False)
    UNION ALL SELECT ID, F1 & F2 AS Result FROM Table1
    UNION ALL SELECT ID, F1 & F2 AS Result FROM Table2;

    Any help would be appreciated.

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I think what he's saying there is that if you are concating two text fields and the result is going to be longer than 255, add a memo field to your table. Leave it blank and use the UNION query to stop the truncation, like so:

    Code:
    SELECT TABLE.MEMO
    FROM TABLE WHERE [MEMO] IS NOT NULL 
    
    UNION ALL 
    
    SELECT TABLE.TEXT1 & TABLE.TEXT2 
    FROM TABLE

  5. #5
    Duval is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    7
    I'm just lost, sorry. Not too experienced with queries. Been digging around there and tried the link but I'm getting lost there too as I'm not seeing the commands that are referenced.

    http://support.microsoft.com/kb/207668

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by Duval View Post
    I'm just lost, sorry. Not too experienced with queries. Been digging around there and tried the link but I'm getting lost there too as I'm not seeing the commands that are referenced.

    http://support.microsoft.com/kb/207668
    That article is saying the same thing as Allen Browne's I think.

    If you want to upload your file Duval, I'd be happy to do it for you. It's a complex concept I know, but let us remember that it doesn't have to be this way if MS was interested at all in creating purposeful software. =)

    Sometimes it makes me feel better knowing that.

  7. #7
    Duval is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    7
    That would really be appreciated and maybe I can pick up something by looking at the sql. http://www.ecologyclub.org/lessonplans.mdb

  8. #8
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    here you go.

    notice the use of the memo field as many times and the number of fields you actually want. I think that's necessary. I put the LEN field in there to just to prove that it's not truncating at 255.

    HTH

  9. #9
    Duval is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    7
    Thanks a ton, downloading now.

  10. #10
    Duval is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    7
    Playing with it now, still getting the truncated text when using combined standard but I'm sure I'll get it. Thank you so much for your time!

  11. #11
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by Duval View Post
    Playing with it now, still getting the truncated text when using combined standard but I'm sure I'll get it. Thank you so much for your time!
    I saw a field there with 257 characters, so I know it works. (Hopefully!) Good luck to you.

  12. #12
    Duval is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    7
    Right you are and thanks again... definitely above and beyond!

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

Similar Threads

  1. Combined "person" field on form
    By Remster in forum Forms
    Replies: 14
    Last Post: 09-15-2010, 10:44 AM
  2. Database size is huge due to memo fields
    By swaroopbhave in forum Import/Export Data
    Replies: 2
    Last Post: 08-07-2010, 11:00 PM
  3. Replies: 2
    Last Post: 08-05-2010, 08:16 AM
  4. Replies: 1
    Last Post: 04-03-2010, 09:35 PM
  5. Format options in combined Form field
    By perry in forum Forms
    Replies: 0
    Last Post: 03-06-2009, 04:53 AM

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