When the user clicks back from a crystal report.

mike55

Contributor
Joined
Mar 26, 2004
Messages
727
Location
Ireland
Hi

I have two drop-down lists, the user is suppose to select data from each drop down, but the data selected from the second drop down must be greater that the value selected from the first drop down.

Now I have a compare validator that compares the data selected from both drop downs when the user clicks on the go button. If they are correct, then the user is directed to another page where a crystal report in .pdf form is displayed. If the data selected is in an incorrect format, then the user is presented with a message in the validation summary.

Now consider the following, my user selects the wrong data first time and clicks the go button. They are warned of the mistake and asked to correct it. So the correct it and click the go button, the report displays. Now the user wishes to change the data they selected originally, they click on the back button. Now here is my problem, the error message is still showing in the validation summary, and will continue to show even if the use is selecting the correct values.

Here is the code that I am using:
Code:
 Private Sub GenerateMemberShipReport()
        Dim active As Int16

        Me.revFrom.IsValid = True
        Me.revTo.IsValid = True

        ' Validate the data selected.
        If validateGroupName() = False Then
            Me.revFrom.IsValid = False
            Exit Sub
        ElseIf ValidateGroupRange = False Then
            Me.CustomValidator1.IsValid = False
            Exit Sub
        End If

        If Me.chkActive.Checked = True Then
            ' Include inactive members.
            active = 1
        Else
            ' Do not include inactive members.
            active = 0
        End If

        Me.vsmOrgMembershipRpt.Dispose()

        If Me.ddlListTo.Visible = False Then
            groupT = "Everybody"
        Else
            groupT = Me.ddlListTo.SelectedItem.Text
        End If

        If Me.ddlGroups.SelectedItem.Value = 0 Then
            If Me.chkSummary.Checked = False Then
                ' Do not generate a summary report.
                Response.Redirect("Suretxt_Reports/MembersReport.aspx?GID=-1&Active=" & active & "&By=" & _
                Session("User") & "&GrpT=" & groupT & "&GrpF=" & groupT)
            ElseIf Me.chkSummary.Checked = True Then
                ' Generate a summary report.
                Response.Redirect("Suretxt_Reports/SummaryReport.aspx?GID=-1&Active=" & active & "&By=" & _
                Session("User") & "&GrpT=" & groupT & "&GrpF=" & groupT)
            End If
        Else
            If Me.chkSummary.Checked = False Then
                Response.Redirect("Suretxt_Reports/MembersReport.aspx?GID=" & Me.ddlGroups.SelectedItem.Value & _
                "&Active=" & active & "&By=" & Session("User") & "&GrpT=" & groupT & "&GrpF=" & _
                Me.ddlGroups.SelectedItem.Text.TrimEnd) 'Do not generate a summary report.
            ElseIf Me.chkSummary.Checked = True Then
                Response.Redirect("Suretxt_Reports/SummaryReport.aspx?GID=" & Me.ddlGroups.SelectedItem.Value & _
                "&Active=" & active & "&By=" & Session("User") & "&GrpT=" & groupT & "&GrpF=" & _
                Me.ddlGroups.SelectedItem.Text.TrimEnd) 'Generate a summary report.
            End If
        End If
    End Sub

Any suggestions?

Mike55.
 
Back
Top