Message box in sql reports

  • I use the following VB function as embedded code in SQL Server reporting 2000 to generate a message box if the date entered is NOT Monday. The message box pops up fine when the date is NOT Monday. The report spans 90 pages(group inserted with page break) and I have to click the message box (vbOkCancel) 90 times before the report shows. I guess for every page rendered, message box pops up once. How I do stop the message box showing up repeatedly? If I click Cancel, the cursor should go back to the parameter text box on the report prompting the user to enter the date again.

    Function CheckDay(ByVal S As DateTime) As Integer

        Dim GivenDate as Date

        Dim GivenDay as Integer

        Dim intMsg as Integer

        

        GivenDate = S

        GivenDay = WeekDay(GivenDate)

        

        If NOT GivenDay = 2

            intMsg = MsgBox("The selected day is not a Monday", VbOKCancel, "The selected date is not a Monday")

        End IF

        Return GivenDay

    End Function

    Thanks in advance.

    Indoaryaan.

  • Hi,

    if u r hectic with msgbox remove the msgbox and keep the action what u want to commit over there.

     

    Thanks & Regards,

    Kumar kP

    Thanks & Regards,
    9989069383
    Katakam.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply