Hello all,
This is my first time posting so I hope I can get some insight into my problem.
I have a subform with a comments section, that, when a comment is entered, and then tabbed off of (loses focus) the code surrounds that statement in parentheses. This is working great. The only problem is that if the that comment is clicked again or is otherwise put back in focus, then when it is tabbed off of or loses focus again, then the vba code surrounds it with more parentheses. If I was the only one using this database I wouldn't care because I could easily just manually avoid the problem, but there are others who use it, and there comments end of looking something like this (((((((Vacation Day)))))) instead of (Vacation Day). Is there anyway to stop my code from executing if my value is met. I've tried a few things but they aren't solving the problem. This is what my current VBA code looks like.
I appreciate any help at all. Let the parenthetical madness stop!!!!!!!!
This is my first time posting so I hope I can get some insight into my problem.
I have a subform with a comments section, that, when a comment is entered, and then tabbed off of (loses focus) the code surrounds that statement in parentheses. This is working great. The only problem is that if the that comment is clicked again or is otherwise put back in focus, then when it is tabbed off of or loses focus again, then the vba code surrounds it with more parentheses. If I was the only one using this database I wouldn't care because I could easily just manually avoid the problem, but there are others who use it, and there comments end of looking something like this (((((((Vacation Day)))))) instead of (Vacation Day). Is there anyway to stop my code from executing if my value is met. I've tried a few things but they aren't solving the problem. This is what my current VBA code looks like.
Code:
Private Sub Comments_LostFocus() Dim Comm As String, OpenPAr As String, CLosePar As String If Not IsNull(Me.Comments.Value) Then Comm = Me.Comments.Value OpenPAr = "(" CLosePar = ")" Me.Comments.Value = OpenPAr & Comm & CLosePar Else End If End Sub
Comment