2010-10-13 65 views

回答

0

假设你有一个叫txtFileName文本框,然后你可以使用它的更新后事件做到这一点:

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

感谢。它不工作..? Private Sub FirstName_AfterUpdate() If Not IsNull(FirstName)Then FirstName = Trim $(FirstName) 如果不是正确$(FirstName,4)=“.zip”Then FirstName = FirstName&“.zip” End If End If End Sub – Peter 2010-10-13 17:06:15

+0

它为我工作...必须有一些其他因素,在我的代码外部。你会怎么样? – awrigley 2010-10-13 19:21:36

相关问题