Results 1 to 5 of 5
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    VBA make new line, enter date and have it at the top of text box

    I've made a memo field that stamps the date on entry event



    Code:
    Me.txtNotes1 = Me.txtNotes1 & Chr(13) + Chr(10) & Format(Now(), "dd/mm/yyyy") & "  "
    however it does it at the end of the memo box.

    I'd like it to go to the start of the memo box, use return key then (I guess) home button to go back to the top then stamp in the date.

    I can't determine the 0 in me.txtNotes.length - I'm not sure how to get to the first line in a memo box.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Combining different data into a single field usually not a good idea.

    Suggest year first.

    Me.txtNotes1 = Format(Date(), "yyyy/mm/dd") & vbCrLf & Me.txtNotes1
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    Combining different data into a single field usually not a good idea.

    Suggest year first.

    Me.txtNotes1 = Format(Date(), "yyyy/mm/dd") & vbCrLf & Me.txtNotes1
    slaps head - duh me

    thanking you

  4. #4
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    Combining different data into a single field usually not a good idea.

    Suggest year first.

    Me.txtNotes1 = Format(Date(), "yyyy/mm/dd") & vbCrLf & Me.txtNotes1
    Curious.

    Because I have it on setfocus, it plants it on each record on the next record (which sometimes isn't needed)

    However I'd like to have it that if there wasn't any text entered then it removes that text just made

    maybe save the text into a string like strSaved

    I was then go through and match any date/line with strSaved and replace it with "" on a condition if another str is empty or something

  5. #5
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    never mind that last question - ive got a simpler solution in my db

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

Similar Threads

  1. Replies: 8
    Last Post: 10-30-2013, 02:28 PM
  2. Field auto enter new line on enter event
    By Ruegen in forum Forms
    Replies: 3
    Last Post: 09-17-2013, 09:00 PM
  3. How to make a subform break line?
    By newyorkyankee in forum Forms
    Replies: 1
    Last Post: 11-01-2012, 12:18 PM
  4. Using Make Table to Enter as Date/Time and Not Binary
    By Jerseynjphillypa in forum Queries
    Replies: 2
    Last Post: 06-20-2012, 11:30 AM
  5. Replies: 5
    Last Post: 02-06-2011, 04:32 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