Results 1 to 15 of 15

Thread: **RESOLVED**SQL Statement - Need a little HELP!

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Location
    New York
    Posts
    679

    **RESOLVED**SQL Statement - Need a little HELP!

    Ok, I thought that I was done, then the Management team pull me back!

    On one of my forms I needed to view only records that follow a certain criteria....within the OnLoad event I have the following code:

    VB Code:
    1. Dim rs as Recordset
    2. Set rs = New Recordset
    3.  
    4. rs.Open "SELECT AgentCompleted FROM Main WHERE AgentCompleted <> ' " & Text1.Text & "'", MyDataEnvironment, MyConnection
    5. rs.MoveFirst
    6. rs.Close
    7. ' so on
    8. ' and so on
    Now this workd great, it opens to the first record that fits the SQL criteria..but now on the form I have a command button for "Next Record"...I wrote the following code inside this command:

    VB Code:
    1. Dim rs as Recordset
    2. Set rs = New Recordset
    3. rs.Open "SELECT AgentCompleted FROM Main WHERE AgentCompleted <> ' " & Text1.Text & "'", MyDataEnvironment, MyConnection
    4. rs.MoveNextrs.Close
    5. 'so on
    but this SQL will not work....it does not give me an error message, but it will not move to the next available record???

    Any suggestions??

    Thanks
    Last edited by Salvatore; May 28th, 2003 at 01:18 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width