Quote Originally Posted by dglienna View Post
Separate the logic, and test!

Dim Flag as Boolean
Dim Test as String
If Test = Trim("TypeName")="" Then Flag=TRUE

If Flag = TRUE then
' Add record only if true
End If
Hi There..... I've tried to do as you suggested but all l get is a blank webpage with error 500. I've copied the code below to see if you think I have made any errors ???

' *** Insert new category, name and link color to the database but allows it me to enter a blank field which it shouldn't ??:

Dim CategoryRS
Set CategoryRS = Server.CreateObject("ADODB.Recordset")
	CategoryRS.Open "SELECT * FROM Type", Connect, 2, 3
If Not Trim("TypeName")=""Then
'	Response.write ("You Have Not Entered A Valid Category Name")
'End If
'Dim Flag as Boolean
'Dim Test as String
'If Test = Trim("TypeName")="" Then Flag=TRUE

'If Flag = TRUE then
' Add record only if true
End If

              <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
                  <td align="left" valign="top"> 
                    <table width="100%" border="0" cellspacing="2" cellpadding="2">
                        <td align="center" valign="middle"><p class="textEvent">&nbsp;</p>
                        <p class="textEvent">The category " 
                          <% Response.Write Request("TypeName")
                        " has been added to the database.</p>
                        <p class="textEvent">&nbsp;</p>
all suggestions and help gratefully accepted..... Regards