UserForm value check

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

I have 2 text boxes and 2 combo boxes on a user form. On
Exit of each box I want to make sure the the box has a
value in it, if not stop and return to the box. I continue
to get a function not defined error. Here is my code for
one of the combo boxes (ComboBox1=January, Combobox2=2004,
Textbox 1 and 2 are keyed in text):

Private Sub cbo_Exit(ByVal Cancel as MSForms.ReturnBoolean)
Dim SStr=frmSetupForm.cboMth.Text
If IsBlank(sStr) Then
MsgBox "Please select month."
Cancel True
End If
End Sub

Thanks
 
Dan,

There is no IsBlank function in VBA. Try

If sStr = "" Then


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top