Results 1 to 3 of 3
  1. #1
    JeRz is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Jul 2014

    On Current Event Question

    Hi Everyone,

    I have a form that has 2 memo fields for notes. I have been able to add a text box underneath the first field that counts the amount of characters used. I am trying to achieve this with the 2nd field. I am relatively new to using code and am unsure how to correctly add this to the On Current even of the form. The current code I have is:

    Private Sub Form_Current()
    'Used in the On Current event of the form
    'to display character count when scrolling
    'through each record
        If Not IsNull(Me.IssueDetail.Text) Then
                Me.txtCharsUsed = Len(Me.IssueDetail.Text) & _
                " characters used in these notes."
                Me.IssueDetail = 0
        End If
        End Sub
    My second set of fields are named Notes (instead of IssueDetail) and txtCharsUsed2 (instead of txtCharsUsed). How would this be entered into this event with basically copying what I have above and subbing the appropriate field names without causing errors?

    Thank you!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Nevada, USA
    You don't really need all that, this should work (you can add back the line continuations if desired):

    Me.txtCharsUsed = Len(Me.IssueDetail & vbNullString) & " characters used in these notes."

    Change the two in red for your other controls.
    Paul (wino moderator)
    MS Access MVP 2007-2019

  3. #3
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    You could also count the number of characters as they type with "Me!chars = Len(Me!Text0.Text)" in the textbox's OnChange event.

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

Similar Threads

  1. Replies: 2
    Last Post: 06-01-2016, 07:53 AM
  2. Replies: 3
    Last Post: 01-14-2015, 02:51 PM
  3. cbo Issue and On Current Event
    By buckwheat in forum Access
    Replies: 10
    Last Post: 08-29-2013, 11:39 AM
  4. How to suppress Current event code?
    By RonL in forum Forms
    Replies: 5
    Last Post: 04-12-2013, 12:43 PM
  5. Information message on current event
    By justauser in forum Forms
    Replies: 5
    Last Post: 02-07-2012, 12:15 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 - Senior Forums