I have an unbound text box on an MS ACCESS 2000 form that has an imput mask set for short dates, i.e. 04/11/09. I have some code within the ON_CLICK event of this control that puts the curser at the front, left hand side, of the text box.
I only want this code to work if there is no value within the text box. It works fine when the textbox is empty and ignors the code as expected if I click on something else after adding a date and then click back into the textbox.
My problem is the textbox has no value if the user is currently typing something in for the first time. If the user is currently typing a date and wants to click on another part of the date to correct it the cursor is positioned at the front regardless of where the user clicked. Following is the code i'm using in the ON_CLICK event, any help would be appreciated.
- If IIf(IsNull(Me.ActiveControl), "", Trim(Me.ActiveControl)) = "" Then
-
Me.ActiveControl.SelStart = 0
-
End If