Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    15

    Unanswered: "Next Without For" and "Block If Without End If"

    I have a "Next Without For" error on the first line of the following code, and a "Block If Without End If" on the End Sub area of the code. Does anyone know why this is happening?

    ---------------------------------------

    Next

    strSQL2 = "SELECT Pipeline, Feature, WheelCountFT, WheelCountIN, StationNumberFT, DepthPERCENT, WTIN, LengthFT, LengthIN, " _
    & "InteriorExterior, OrientationCLOCKWISE, BurstModB31G, RPRModB31G, BurstEffArea, RPREffArea, SMYS, DistFromUSWeldFT, " _
    & "DistFromUSWeldIN, DistFromDSWeldFT, DistFromDSWeldIN, DistToUSAGMIN, DistToUSAGMIN, DistToDSAGMFT, " _
    & "DistToDSAGMIN, JointLengthFT, JointLengthIN, Comments, Latitude, Longitude, Elevation, AdditionalComments " _
    & "FROM qryOpenQryTrans_Report "
    '& "FROM qryOpenQryTrans "


    If intY > 0 Then
    strSQL = strSQL & " WHERE " & strSQL2
    End If

    Me.txtSQL2.Value = strSQL2
    Me.frmSubOpenQryTrans.Form.RecordSource = strSQL2

    Close_cmdRun_Click:
    Exit Sub

    Err_cmdRun_Click:
    MsgBox Err.Description
    Resume Close_cmdRun_Click

    End Sub

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    What more up the sentence NEXT.........
    Saludos
    Norberto

  3. #3
    Join Date
    Oct 2003
    Posts
    15
    Thank you for responding. Once I restarted my computer, the code worked!

Posting Permissions

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