Results 1 to 5 of 5

Thread: [RESOLVED] Access 2003 Recordset problem

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Location
    Botswana
    Posts
    107

    Resolved [RESOLVED] Access 2003 Recordset problem

    hey everyone. can anyone look at my code and tell me what im doing wrong? im trying to open up a recordset with all rows from a table but when i do, it just has the first row. i know the sql string is correct because when i run it in the querry builder, it has all rows
    Code:
    Option Compare Database
    Private Sub Report_Open(Cancel As Integer)
    On Error GoTo errorhandler
    Dim SelectStrings As String
    Dim MyRecordSets As Recordset
    Dim QuestionArrays As Variant
    Dim Counters As Integer
    
    SelectStrings = "Select * From tblQuestionResults"
    Set MyRecordSets = CurrentDb.OpenRecordset(SelectStrings)
     
    If Not MyRecordSets.EOF Then QuestionArrays = MyRecordSets.GetRows(MyRecordSets.RecordCount)
    Counter = MyRecordSets.RecordCount
    MsgBox (Counter)
    MyRecordSets.Close 
    
    errorhandler:
    If Err.Number = 0 Then
    Else
    MsgBox (Err.Description)
    End If
    End Sub
    Last edited by Hack; Jun 23rd, 2008 at 11:29 AM. Reason: Added Code Tags

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