我有一个带有自定义表单的Access 2000数据库。人们正在输入信息。在其中一个字段中,我想自动将“.zip”附加到其中一个字段。
如何?
答案 0 :(得分:0)
假设您有一个名为txtFileName的textBox,那么您可以使用其AfterUpdate事件来执行此操作:
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