开发者

How replace text value of textbox in access 2007

开发者 https://www.devze.com 2023-03-20 02:42 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消