Results 1 to 7 of 7
  1. #1
    ssissons is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2014
    Posts
    44

    Text box with more than 255 characters

    I apologize if this is a duplicate question.



    In Access 2007 -

    I have a form with a text box. I have a memo field in multiple tables. I can type more than 255 characters in the text box, save it to the memo field. If I look at the table in datasheet format, the entire contents of the textbox (> 255) are saved. BUT, going back to the form, if I retrieve the memo field and put the contents into the text box, it is cut off at the 255 character point. Is there a way to change the limit on the text box besides binding it to a table field, or is there another control which will allow for more than 255 characters?

    Thanks!
    Scott

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Sounds like there may be an issue with how you are populating the text box when you retrieve the memo field.

    How are you doing that, if the text box is not bound to the table field?

    John

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    John's got the right idea...basically Queries truncate Memo Fields to 255 characters, as do some formatting functions. Allen Browne has an excellent article on the subject here:

    http://allenbrowne.com/ser-63.html

    Linq ;0)>

  4. #4
    ssissons is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2014
    Posts
    44
    Here is the relevant code. LongDescription is defined as a MEMO field in the table. txtDescription is the text box, allowing for multi-line entry.

    strSelect = "SELECT DISTINCT Requestor, Create_Date, Status, ShortDescription, LongDescription, Priority, System, AssignedTo FROM Issues WHERE TTP_No = " & varSelectedTTP
    Set rstIssues = CurrentDb.OpenRecordset(strSelect)

    If varSelectedTTP > 0 Then
    If rstIssues.RecordCount = 0 Then
    MsgBox "That TTP number does not exist in the database."
    ResetTTP
    Else
    With rstIssues
    txtTTP_No = CStr(varSelectedTTP)
    txtRequestor = !Requestor
    txtCreateDate = !Create_Date
    cboStatus.Value = !Status
    txtShortDescription = !ShortDescription
    txtLongDescription = !LongDescription
    cboPriority.Value = !Priority
    cboSystem.Value = !System
    txtAssignedTo = !AssignedTo
    txtCreateDate.Visible = True
    lblCreateDate.Visible = True
    End With

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    You're using SELECT DISTINCT in your SQL Statement; go back to Allen Browne's article and read the entry under Uniqueness and it should be apparent what the problem is.

    Linq ;0)>

  6. #6
    ssissons is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2014
    Posts
    44
    That was it! Removing the DISTINCT solved the problem. Thanks so much!

  7. #7
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    It's all in the details!

    Good luck with your project!

    Linq ;0)>

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

Similar Threads

  1. Replies: 7
    Last Post: 06-20-2014, 08:55 PM
  2. Replies: 1
    Last Post: 05-01-2014, 11:33 AM
  3. enter more than 255 characters in a text box
    By reddy4305 in forum Access
    Replies: 2
    Last Post: 10-26-2010, 06:29 AM
  4. characters in text boxes
    By Matthieu in forum Access
    Replies: 0
    Last Post: 04-08-2010, 11:02 AM
  5. Counting Characters in a text field
    By velvettiger in forum Queries
    Replies: 1
    Last Post: 03-12-2010, 12:36 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