Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Memo Filed Size? (Access97)

    I'm trying to execute the following code so that my Memo field retains its content but a vbCRLf and current date is added at the end when I click on a button. I get an error regarding the size of OldActivitiesContent & vbCrLf & Date & "-". Any help appreciated! Thanks!
    - - - - -
    Dim OldActivitiesContent

    Forms!MyRecords!Activities.SetFocus
    OldActivitiesContent = Forms!MyRecords!Activities.Text
    Forms!MyRecords!Activities.Text = OldActivitiesContent & vbCrLf & Date & "-"

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Memo Filed Size? (Access97)

    What message?
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Memo Filed Size? (Access97)

    As Charlotte stated, the error message is needed, but since I was here and I have code that does something similar to what you are trying to accomplish, I thought I'd post it. The code is activated on the Enter event of my memo field (called Notepad) and keeps the current contents of the field, placing the Date, a colon and the cursor on a new/separate line. Actually Charlotte was the person who send me a sample database that helped me do this. (Thanks again Charlotte, it continues to work like a charm) Post back if you want the sample db as well.

    Private Sub Notepad_Enter()

    Dim vDate As Date
    Dim vColon As String

    vDate = Format(Date, "Short Date")
    vColon = ": "

    Me![Notepad] = Me![Notepad] & vbCrLf & vbCrLf & vDate & vColon
    Me![Notepad].SelStart = Len(Me![Notepad]) + 1
    SendKeys (vbCr)

    End Sub

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Memo Filed Size? (Access97)

    Worked like a charm! Thanks everyone!

  5. #5
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Memo Filed Size? (Access97)

    I see someone answered your question, but I thought I'd add this comment. When you use:

    Dim OldActivitiesContent

    You are declaring OldActivitiesContent to be a Variant datatype. Variant processing is always slower than declared datatypes, plus it is harder to detect errors since variants accept any data you give them.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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