Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with adding data from a form to a database

Status
Not open for further replies.

oas2009

Programmer
Feb 26, 2009
3
US
Code:
Private Sub btnSaveAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveAdd.Click
   Call AddJob()
   If invalid Then
      lblErrMsg.Text="Correct errors indicated below, then try again."
      lblErrMsg.ForeColor = System.Drawing.Color.Red
      lblErrMsg.Font.Bold = True
            Exit Sub
        End If
        If blnLenError Then
            MsgBox("Job Description cannot exceed 2000 characters.")
            Exit Sub
        Else
            Call ClearForm()
            ddState.SelectedItem.Text = "FL"
        End If
    End Sub


The above function is called when the user wants the job is added and the employer wants to add another. After the job is added, this function is called to clear the form and repost a clean & clear version of the AddJob.aspx

My problem is that after the user has selected Save & Go Back or Save & Add Another, the ClearForm , transfers the values of form fields to the values of the objects. After the form has cleared all the fields, the values are still located in the variables waiting to be added to the database. However, during the postback, the form comes back clear and the information stored in the form variables are cleared without being added to the database
 
Hi, you should post ASP.Net related questions in the following forum:

forum855

The VB.Net forum gets more posts related to Windows Forms/Console Apps/Windows Services/User Controls/Class Libraries and VB.Net syntax.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top