I have text-box in some form in access 2007. I am trying to replace all the dots(.) in the text of the text box with some VBA.
This is what i开发者_JAVA百科 did:
Private Sub eng_name_LostFocus()
Dim val As String
val = Replace(eng_name.Value, ".", " ")
eng_name.Value = val
End Sub
but its do nothing...
what can i change to work it out?
Private Sub eng_name_AfterUpdate()
Me!eng_name = Replace(Me!eng_name, ".", " ")
End Sub
I think you only need AfterUpdate, as it is only triggered when the value of eng_name
is changed.
I always use Me!ControlName to get/set the value of a control in Access.
精彩评论