= 389V ----- END PGP SIGNATURE ----- 我可能会投入我使用的内容: http: //groups.google.com/group/comp....a0bbcaf3f5428c James A. Fortune CD ******** @ FortuneJames.com Can I somehow set a max length of chars enteredinto an unbound textbox control? 解决方案 The below code will limit the number of characters to 10.Code the unbound text control''s Change event: Private Sub ControlName_Change()If Len([ControlName].Text) = 11 ThenMsgBox "No more then 10 characters are permitted."[ControlName].Text = Left([ControlName].Text, 10)End If End Sub Change [ControlName] to whatever the actual name is of your unboundcontrol.--FredPlease respond only to this newsgroup.I do not reply to personal e-mail -----BEGIN PGP SIGNED MESSAGE-----Hash: SHA1 One way is in the BeforeUpdate event of the control: Private Sub TextBoxName_BeforeUpdate(Cancel As Integer) If Not IsNull(Me!TextBoxName) ThenIf Len(Me!TextBoxName)>200 ThenMsgBox "Too Long. Must be <= 200 characters"Cancel = TrueEnd IfEnd If End Sub--MGFoster:::mgf00 <at> earthlink <decimal-point> netOakland, CA (USA) -----BEGIN PGP SIGNATURE-----Version: PGP for Personal Privacy 5.0Charset: noconv iQA/AwUBQ/DGP4echKqOuFEgEQI2/ACg1OrLoU4dmt08QDGLHaI8hLoDu/oAoKP2e/mwmh05UNq1fZERevGI9g3Z=389V-----END PGP SIGNATURE----- I might as well throw in what I use: http://groups.google.com/group/comp....a0bbcaf3f5428c James A. Fortune CD********@FortuneJames.com 这篇关于A97:将未绑定文本框限制为200个字符的最简单方法是输入MAX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-29 11:10