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

    Field auto enter new line on enter event

    I have a memo field on a form that I hope when the user enters the form (with insert and not select, don't want the auto of key "enter" to type over what text is already in the field thus deleting it all) and a new line is created ready for them to type - much like pressing the enter key.

    Also if possible and not sure if - only does it once on the first enter but again after unless the form is opened.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    I'm not following your post. Perhaps you could give a sample of the issue.

    If you are appending to the end of an existing memo field, you may want your code to go to the end of the current data, then append to that data and rewrite the field. If you want to insert a CrLf, you could do that as well using vbCrLf.

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    When you type, in a memo field, you press enter to create a new line to type.

    I want that automated when you first enter the memo field, just once. A new line is created ready for you to type rather than add it to the previous sentence in that memo field.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    vbCrLf is like the enter key. I believe it translates to "Carriage Return Left". So there are other vbCr or Cr options too.

    You could declare a string within your form, at the top so it is public within your form. Then you could have your string equal the value of your memo in the form's current event or on an enter event, and another event too since your string will be public to the form. On the next line of code you could add something like

    strMsg = strMsg + " " & vbCrLf
    strMsg = strMsg + "" & vbCrLf

    The only problem is I believe it will place your curser on the entire message. You can give it a try though. There are settings to control what the curssor does. Like if you double click how much does it highlight, etc. But those are global settings I believe. I would like to know what you find. Below is an example of how I use vbCrLf. It is a great to for MsgBoxes to.


    strMsg = "Loaded Import Container number " & strContainer & " is in the yard." & vbCrLf
    strMsg = strMsg + "Customer is " & strCustomer & ". " & vbCrLf
    strMsg = strMsg + "Customer PO is " & strPO & ". " & vbCrLf
    strMsg = strMsg + "Steamship BOL is " & strSteamBOl
    Last edited by ItsMe; 09-17-2013 at 09:02 PM. Reason: Bad First Example

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

Similar Threads

  1. Replies: 1
    Last Post: 08-24-2012, 06:50 AM
  2. Form auto enter field on new record click
    By Traceyann in forum Forms
    Replies: 3
    Last Post: 08-18-2012, 08:39 AM
  3. auto enter sequential numbers
    By normie in forum Access
    Replies: 5
    Last Post: 05-25-2012, 10:38 AM
  4. Replies: 6
    Last Post: 04-27-2012, 01:31 PM
  5. Replies: 1
    Last Post: 08-15-2011, 03:20 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