Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filling left to right in date fields

Status
Not open for further replies.

CharlieT302

Instructor
Mar 17, 2005
406
US
Hi Folks,

Here is a question that has been driving me nuts. I have a form containing a date field with a ShortDate format applied and an input mask of: 99/99/0000;0;_

On new records, when the user clicks into the date field, the typing always begins from the left - even if they clicked in the year portion of the mask. If a date already exists, the cursor does not move and the user can edit the date. This works great.

However, my other forms do not behave this way. The typing always begins where the cursor is sitting. All forms are tied to the same table, same field, and with the same format and input mask.

I have not placed any type of code on these fields, nor do I know why the first form behaves as it does. I keep looking for some property setting that causes it to fill from the left.

Does anyone know what would cause it do so, or how to mimic it again?

Thanks,
 
This might be something that can mimic this control behaviour:

Code:
Private Sub VBACodeName_MouseUp
(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
'set the cursor on the beginning on mouseup()
Me!VBACodeName.SelStart = 0

End Sub

Pampers [afro]
Keeping it simple can be complicated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top