开发者

Access 2000 automaticly add text to a form entry field

开发者 https://www.devze.com 2023-01-20 10:24 出处:网络
I have an Access 2000 database with a custom form.People are entering info into this.On one of the fields I want to automatically a开发者_StackOverflowppend a \".zip\" to one of the fields.

I have an Access 2000 database with a custom form. People are entering info into this. On one of the fields I want to automatically a开发者_StackOverflowppend a ".zip" to one of the fields.

How?


Assuming you have a textBox called txtFileName, then you can use its AfterUpdate event to do this:

Private Sub txtFileName_AfterUpdate()
    If Not IsNull(txtFileName) Then
        txtFileName = Trim$(txtFileName)
        If Not Right$(txtFileName, 4) = ".zip" Then
            txtFileName = txtFileName & ".zip"
        End If
    End If
End Sub
0

精彩评论

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