Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    New Zealand
    Posts
    47

    Unanswered: sql, rst with no record.

    Hi everyone.

    I have these lines of sql code populating serveral recordsets.

    sqlMastLine = (Nz("select * from Mast_Detail_Line, QuoteMast where cstr(Mast_Detail_Line.Quote_Detail_ID) =" + CStr(strDetail) + " AND Mast_Detail_Line.Mast_ID = QuoteMast.ID"))
    several similar lines.

    Then i have loops that will write the recordset data to a word document, but the loops through out errors if the resordset has no data in it!

    How can i get around this, so it just misses the loop.

    Im using "DO While not rstMachine.EOF" loops. i get an error telling me that the EOF or BOF condition is true and it request a current record. Is there another way i can perform this.

    If Im not very clear just ask for more information. ALways keen to share.

    Thanks for your help everyone.
    Nerdy Girl

  2. #2
    Join Date
    Feb 2002
    Posts
    403
    To avoid the loop is no records exist place an if statement around your loop.

    If not rstMachine.BOF or Not rstMachine.eof then

    Loop

    End if

  3. #3
    Join Date
    Nov 2003
    Location
    New Zealand
    Posts
    47
    Thanks,

    thats really obviouse......Duh
    Nerdy Girl

Posting Permissions

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