View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default Type mismatch error

Is 'lFacilRowsUI' text or Value? If it is Value, I think if it is Text, you
need something like this:
"'" Or lFacilRowsUI = "'"
That is a apostrophe between the quotes.
If it is Value, i think you need something like this:
" Or lFacilRowsUI = "

HTH,
Ryan---
--
RyGuy


"salgud" wrote:

The following code tests if the user has input both pieces of data before
proceding with the program. But I'm getting a Type Mismatch error on the IF
test.

Sub UserInputCheck()
frmFacil.Hide
sFacilNameUI = frmFacil.tbFacilName.Text
On Error Resume Next
lFacilRowsUI = frmFacil.tbFacilRows.Value
On Error GoTo 0
If sFacilNameUI = "" Or lFacilRowsUI = "" Then <------TYPE MISMATCH ERROR
MsgBox "Please enter a both a Facility Name and" & Chr(10) & _
"the number of clients served!", vbOKOnly
Call GetFacilName
End If

End Sub

How do I test for no entry on the lFacilRowsUI variable?