Alpha Video Training
Results 1 to 8 of 8

Thread: Memo Field Size Limit

  1. #1
    Member
    Real Name
    Jon
    Join Date
    Jan 2009
    Posts
    343

    Default Memo Field Size Limit

    Is there a way to limit the size of the memo field data. Right now a user can type as much as they want. The problem I'm having is that I have the memo field tied to a report and the area on the page is only so big and sometimes a user will get carried away with what there typing and when a report is printed some of what they type is "cut off". Any suggestions... Thank you in advance

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,310

    Default Re: Memo Field Size Limit

    Isn't there an option to "allow growth when printing" for the object in your report layout that displays the memo field text? Check the properties of that object in your report layout.

  3. #3
    Member
    Real Name
    Jon
    Join Date
    Jan 2009
    Posts
    343

    Default Re: Memo Field Size Limit

    Thanks Tom for the reply. Yes that is an option but I would still like limit the size of the memo field.

  4. #4
    Volunteer Moderator Steve Workings's Avatar
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,619

    Default Re: Memo Field Size Limit

    Here's one way:

    Put the memo field on a form.

    Add a session variable to the form called memo_length.

    Put the variable on the form for display purposes.

    In form properties, set the form timer to one second.

    Add this code to your form's OnTimer event (field name in the code below is "m1" and the object containing the variable on the form is named "memo_length"

    Code:
    dim shared memo_length as n
    memo_length = len(alltrim(m1.text))
    memo_length.refresh()
    
    if memo_length > 10
    	msgbox("Memo Length", "Maximum 10 chars.")
    	m1.text = left(m1.text,10)
    end if
    I've added a .zip of the table and form to this message if that helps.
    -Steve


  5. #5
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Memo Field Size Limit

    You could also place Steve's code just on the OnKey event without a timer.

    If you did not want to count spaces for some reason you could also use
    len(strtran(alltrim(m1.text)," ","")) for the character count......just a thought/alternative.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  6. #6
    Member
    Real Name
    Garry M Flanigan
    Join Date
    Jul 2004
    Location
    Melbourne, Australia
    Posts
    909

    Default Re: Memo Field Size Limit

    This is a good plan but not foolproof. For example, someone uses lots of crlf's.
    Garry

  7. #7
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Memo Field Size Limit

    Not to take away from the suggestions made which are good except that I don't like OnTimer and OnKey events, so here is couple alternatives:
    1-Use same script per Steve, but instead of the OnTimer event, put it in the OnDepart event of the RTF, or
    2-Instead of the user entering text directly in the RTF, remove the RTF from the form and instead embedd an xdlg in the form in place of the RTF and make it a multi-line input object with a max number of characters (Or just overlap the xdlg on top of the RTF object). In the OnSave event, the contents of the text object in the xdlg will be saved to your memo field in the table.

  8. #8
    Member
    Real Name
    Jon
    Join Date
    Jan 2009
    Posts
    343

    Default Re: Memo Field Size Limit

    Cannot get zip file to open. Any suggestions?

Similar Threads

  1. fixed size memo field
    By Steve Wood in forum Alpha Five Version 7
    Replies: 3
    Last Post: 05-17-2006, 04:21 PM
  2. Field Rule size limit
    By PCS in forum Alpha Five Version 5
    Replies: 3
    Last Post: 10-20-2003, 09:15 AM
  3. Field Rule size limit
    By PCS in forum Alpha Five Version 5
    Replies: 6
    Last Post: 10-17-2003, 02:55 PM
  4. Field Rule size limit
    By PCS in forum Alpha Five Version 5
    Replies: 0
    Last Post: 10-17-2003, 10:43 AM
  5. Memo Field Size
    By Sam Wagoner in forum Alpha Five Version 5
    Replies: 0
    Last Post: 09-19-2003, 05:14 PM

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
  •