Textbox မွာ စာလံုးေရ ကန္႕သတ္ခ်င္ရင္ ေအာက္က နမူနာကို သံုးပါ။
Private Sub UserReport_Exit(Cancel As Integer)
Dim NoOfWords As Long
NoOfWords = Len(Trim(Me.UserReport)) - Len(Replace(Me.UserReport, " ", "")) + 1
If NoOfWords > 200 Then
MsgBox "No. of Words=" & NoOfWords & vbCrLf & " 200 Words Max., Please", vbCritical
Cancel = True
End If
End Sub
Download Example
No comments:
Post a Comment