View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
salgud salgud is offline
external usenet poster
 
Posts: 219
Default Type mismatch error

On Tue, 10 Mar 2009 13:57:52 -0700, Tim Zych wrote:

Is lFacilRowsUI declared as a Long?

If so evaluating it as a string will cause that error.

If lFacilRowsUI has not been assigned a value, it will default to 0 if
declared as a Long.

One way to fix it:

If sFacilNameUI = "" Or lFacilRowsUI = 0

But if 0 is an acceptable entry another approach is needed such as:

If frmFacil.tbFacilName.Text = "" And frmFacil.tbFacilRows.Text = "" Then
MsgBox "Please enter a both a Facility ...."
'...
End If


Thanks, Tim!