Function sendit_OnClick

Dim pos1, lenEmail, diff1


If Trim(frmquote.send_name.value) = "" Or Len(Trim(frmquote.send_name.value)) < 2 Then
	MsgBox "Please enter your name.",vbInformation+vbOkOnly,"Incomplete Information"
	sendit_OnClick = False 
	Exit Function
End If

If Trim(frmquote.send_email.value) = "" Or Len(Trim(frmquote.send_email.value)) < 6 Then
	MsgBox "Please enter your email address.",vbInformation+vbOkOnly,"Incomplete Information"
	sendit_OnClick = False 
	Exit Function
End If

If InStr(frmquote.send_email.value,Chr(64)) < 2 Or InStr(frmquote.send_email.value,".") < 1 Or Right(frmquote.send_email.value,1)="." Or InStr(frmquote.send_email.value,",") > 0 Then
	MsgBox "Please enter a valid email address.",vbInformation+vbOkOnly,"Incomplete Information"
	sendit_OnClick = False
	Exit Function	
End If

If InStr(frmquote.send_email.value,".") > 1 Then
	pos1 = InStrRev(frmquote.send_email.value,".")
	lenEmail = Len(frmquote.send_email.value)
	diff1 = lenEmail-pos1
	If diff1 > 3 Or diff1 < 2 Then
		MsgBox "Please enter a valid email address.",vbInformation+vbOkOnly,"Incomplete Information"
		sendit_OnClick = False
		Exit Function	
	End If
End If

If Trim(frmquote.send_company.value) = "" Then
	MsgBox "Please enter your company's name.",vbInformation+vbOkOnly,"Incomplete Information"
	sendit_OnClick = False 
	Exit Function
End If

If Trim(frmquote.num_PC.value) = "" Then
	MsgBox "Please enter your number of PCs.",vbInformation+vbOkOnly,"Incomplete Information"
	sendit_OnClick = False 
	Exit Function
End If

If Trim(frmquote.subj.value) = "" Then
	MsgBox "Please enter a subject for your message.",vbInformation+vbOkOnly,"Incomplete Information"
	sendit_OnClick = False 
	Exit Function
End If

End Function
