Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: Type Missmatch Error, it all looks good to me

    Heres the code:
    Option Compare Database
    Option Explicit
    Dim rs As ADODB.Recordset

    Private Sub Form_Load()


    Set rs = New ADODB.Recordset

    Me.txtLastCkDate.Value = GetLastCkDate(rs)

    Set rs = GetCVRRS(rs)

    AddNewData (rs) <--- I GET THE ERRROR HERE!!!!
    dont understand it
    GetCVRRS returns a :ADODB.Recordset
    AddNewData returns a : ADODB.Recordset
    WHERE IS THE MISS MATCH???

    End Sub

    Private Function GetCVRRS(rs As ADODB.Recordset) As ADODB.Recordset
    Dim Dept As String

    sql = "SELECT * something from somwher"

    rs.Open sql, yada, yada, yada

    If rs.RecordCount > 0 Then
    rs.MoveFirst
    ............
    ............
    ............
    End If

    Set GetCVRRS = rs
    End Function

    Private Sub AddNewData(rs As ADODB.Recordset)
    Dim OldRs As ADODB.Recordset
    Set OldRs = New ADODB.Recordset
    Set OldRs = GetOldRS(OldRs)

    Do While Not rs.EOF

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Why are you passing the recordset as a parameter to your functions WHENS IT'S GLOBAL to the ENTIRE module? You don't need to do that - just access the recordset ...

Posting Permissions

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