Results 1 to 3 of 3

End if without If Block

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-09-2006
    Posts
    109

    End if without If Block

    I have this lovely query. There is a section with a nested if. I have a total of two ifs and two end ifs. For some reason, the compiler is saying i have an End if without an If block. I think it lies.

    Dim bd As Database
    Dim rs As Recordset
    
    
    Set db = CurrentDb
    Set rs = db.OpenRecordset("Report_log2", dbOpenDynaset)
    
    With rs
        Do While Not .EOF
            If rs!acct_reference_id = Reports![report]!ID And rs!approval_status = "Pending" And rs!ModDate > Date - 30 Then
                Response = MsgBox("You have already processed this report as Pending within the last 30 days. Do you want to override that entry?", vbOKCancel, "Override?")
                If Response = 1 Then GoTo run_report
                    Else
                        GoTo Cancel
                End If
            End If
        .MoveNext
        Loop
    End With
    Of course, I must be going something wrong, but for the life of me i cannot figure out what. Perhaps it's the Gotos?

    Any advice will be greatly appreciated.

    Chris
    Last edited by cbh35711; 03-12-2012 at 04:34 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1