Dim Submission

Function frmIndex_Submit(mForm)
   with mForm
       Submission = "True"

       if .Category.selectedIndex = 0 then
          msgbox "Error: Pls select a category from the list!", vbCritical, "No Category Selected"
          .Category.focus()
          Submission = "False"
          exit function
       end if
       if trim(.txtTitle.value) = "" then
          msgbox "Error: Pls enter the Title!", vbCritical, "No Title Entered"
          .txtTitle.focus()
          Submission = "False"
          exit function
       end if
       if trim(.txtHeader.value) = "" then
          msgbox "Error: Pls enter the Summary Paragraph!", vbCritical, "No Summary Paragraph Entered"
          .txtHeader.focus()
          Submission = "False"
          exit function
       end if
       if trim(.txtKeyWords.value) = "" then
          msgbox "Error: Pls enter the Keywords!", vbCritical, "No Keywords Entered"
          .txtKeyWords.focus()
          Submission = "False"
          exit function
       end if
       if trim(.txtContent.value) = "" then
          msgbox "Error: Pls enter the Article!", vbCritical, "No Article Entered"
          .txtContent.focus()
          Submission = "False"
          exit function
       end if
       if trim(.txtWebName.value) = "" then
          msgbox "Error: Pls enter the Company Name!", vbCritical, "No Company Name Entered"
          .txtWebName.focus()
          Submission = "False"
          exit function
       end if
       if trim(.txtWebAddress.value) = "" OR len(.txtWebAddress.value) <= 7 then
          msgbox "Error: Pls enter the WebURL!", vbCritical, "No WebURL Entered"
          .txtWebAddress.focus()
          Submission = "False"
          exit function
       elseif trim(.txtWebAddress.value) <> "" OR instr(1, .txtWebAddress.value, "http", vbTextCompare) = "0" then
          if len(trim(.txtWebAddress.value)) <= 7 then
             msgbox "Error: Please enter the correct Web URL!",vbCritical,"Invalid WebURL entered"
             .txtWebAddress.value = "http://"
             .txtWebAddress.focus()
             Submission = "False"
             exit function
          end if
       end if
       if trim(.txtAuthor.value) = "" then
          msgbox "Error: Pls enter the Author Name!", vbCritical, "No Article Name Entered"
          .txtAuthor.focus()
          Submission = "False"
          exit function
       end if
       if trim(.txtEmail.value) = "" then
          msgbox "Error: Pls enter your Author Email!", vbCritical, "No Email Entered"
          .txtEmail.focus()
          Submission = "False"
          exit function
       elseif instr(1,.txtEmail.value,"@",vbTexCompare) = 0 OR instr(1,.txtEmail.value,".",vbTexCompare) = 0 then
          msgbox "Error: Pls enter a valid Email Address.", vbCritical, "Invalid Email Address"
          .txtEmail.focus()
          Submission = "False"
          exit function
       end if
   end with
End Function
