CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: bas Module

  1. #1
    Guest

    bas Module

    Hi

    I try to do a function in a bas module and pass it a recordset. But my pgm always crash saying that its an undefine function. Is there someone who know why?

    Here what i'm doing

    [vbcode]
    rst.Open "select tblinput.numeroEmploye, tblinput.date, Employes.nomFamille, Employes.Prenom FROM tblinput, Employes WHERE tblinput.numeroEmploye = Employes.NumEmploye And tblinput.ValidationMarie = 'Faux' GROUP BY tblinput.NumeroEmploye, tblinput.date, Employes.Prenom, Employes.NomFamille", _
    "DSN=Feuille de temps", adOpenDynamic, adLockOptimistic

    List rst

    --------------
    in my bas module :

    Private Sub List(rst As Recordset)

    frmliste.ListView1.ColumnHeaders.Add Text:="Numéro Employe", Width:=2000
    frmliste.ListView1.ColumnHeaders.Add Text:="Nom", Width:=2000
    frmliste.ListView1.ColumnHeaders.Add Text:="Date", Width:=3290

    If Not rst.EOF Then
    Do Until rst.EOF
    With frmliste.ListView1
    .View = lvwReport
    Set li = .ListItems.Add(Text:=rst![NumeroEmploye] & "")
    li.ListSubItems.Add Text:=rst![Prenom] & " " & rst![nomFamille] & ""
    li.ListSubItems.Add Text:=rst![Date] & ""
    End With
    rst.MoveNext
    Loop
    Else
    MsgBox "Tous les employés ont été validés.", vbOKOnly
    End If

    End Sub

    [/vbcoe]



  2. #2
    Join Date
    Jul 1999
    Posts
    15

    Re: bas Module

    Change your function type from "Private Sub" to Public Sub

    surge


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

Featured