How to check for a blank masked edit box

HotBBQ
04-06-2003, 09:56 PM
I have a masked edit box that I would like to check for blankness. I have tried the piece of code below, but it doesn't work, the blank text gets printed anyways. I have a mask of ###.##

If mboxPrice.Text <> "" Then
' Do Something
End If

Thanks!

FireBird
04-07-2003, 12:31 AM
Does this code do what you want


Private Sub Command1_Click()
If Me.MaskEdBox1.Text <> "" Then
For i = 1 To Len(Me.MaskEdBox1.Text)
If Asc(Mid(Me.MaskEdBox1.Text, i, 1)) >= 48 And Asc(Mid(Me.MaskEdBox1.Text, i, 1)) <= 57 Then
MsgBox Asc(Mid(Me.MaskEdBox1.Text, i, 1))
Else
MsgBox "Please Fill Correctly"
Me.MaskEdBox1.SetFocus
Exit For
End If
Next
End If
End Sub

HotBBQ
04-07-2003, 02:40 AM
Does this code do what you want

I tried your code, and doesn't seem to do what I was looking for. I just wanted to check to see if it was blank, and if so, skip a label update. Thank you though.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum