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

    Custom class not working on Enter key

    I have a field that when you press return after typing you fire off some functions

    Code:
    Private Sub txtEnterMemo_KeyDown(KeyCode As Integer, Shift As Integer)
    
    
    
    
    If KeyCode = vbKeyReturn Then
    Debug.Print "Entry Made"
        Dim memoNew As MainMemoClass
        Set memoNew = New MainMemoClass
    '    Debug.Print "The Tour Organiser ID is: " & TempVars!tmpTO_ID
        memoNew.newMemo Me.txtEnterMemo, Me.NewSchoolsID, TempVars!tmpTO_ID.Value
        memoNew.saveMemo Me.txtEnterMemo
    
    
        Me.txtMemoWell = memoNew.updateMemoList(Me.NewSchoolsID)
        
    '    Debug.Print "Date: " & memoNew.MemoDS
    '    Debug.Print "School ID: " & memoNew.MemoSchoolID
    '    Debug.Print "Memo: " & memoNew.MemoField
    
    
    End If
        
    End Sub
    however for some reason I have to press enter a second time after pressing it (which means I have to move the courser into the field again because it jumps out).



    any suggestions?

  2. #2
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    the Enter Key Behaviour is on default for the control if that helps. I don't need new line either.

    Also would like this event to fire when I move to the next record - before the next record is shown on the form. Don't know which event to use

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

Similar Threads

  1. Replies: 2
    Last Post: 05-27-2014, 11:32 AM
  2. Implementing Custom Class Objects-Where should they go?
    By Monterey_Manzer in forum Database Design
    Replies: 5
    Last Post: 04-07-2014, 12:15 PM
  3. Field auto enter new line on enter event
    By Ruegen in forum Forms
    Replies: 3
    Last Post: 09-17-2013, 09:00 PM
  4. Replies: 5
    Last Post: 02-06-2011, 04:32 PM
  5. Replies: 0
    Last Post: 01-27-2011, 09:58 AM

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