tgstephens
New member
- Local time
- Today, 00:36
- Joined
- Sep 15, 2010
- Messages
- 3
Access experts,
I'm trying to write what I thought would be a simple line of code on the Lost Focus event to find out if the 34th character in a text box on a form is a period (.) and, if so, replace it with a comma (,). Sounds simple, right? Yeah....not so much. I've been trying several iterations of the below but nothing seems to work:
If Mid(Me.BLOCK35, 34, 1) = "." Then Replace(Me.BLOCK35, 34, 1), ",")
This, however DOES work but it requires the user to make the manual change. I want the change to be automatic and transparent to the user.
If Mid(Me!BLOCK35, 34, 1) = "." Then MsgBox "yada yada yada"
If Mid(Me!BLOCK35, 34, 1) = "." Then Me.BLOCK35.SetFocus
If Mid(Me!BLOCK35, 34, 1) = "." Then Me.BLOCK35.SelStart = 34
Any ideas? Thanks!!
Tommy Stephens
I'm trying to write what I thought would be a simple line of code on the Lost Focus event to find out if the 34th character in a text box on a form is a period (.) and, if so, replace it with a comma (,). Sounds simple, right? Yeah....not so much. I've been trying several iterations of the below but nothing seems to work:
If Mid(Me.BLOCK35, 34, 1) = "." Then Replace(Me.BLOCK35, 34, 1), ",")
This, however DOES work but it requires the user to make the manual change. I want the change to be automatic and transparent to the user.
If Mid(Me!BLOCK35, 34, 1) = "." Then MsgBox "yada yada yada"
If Mid(Me!BLOCK35, 34, 1) = "." Then Me.BLOCK35.SetFocus
If Mid(Me!BLOCK35, 34, 1) = "." Then Me.BLOCK35.SelStart = 34
Any ideas? Thanks!!
Tommy Stephens