Kan man hente flere felter med dette modul ??
HejSom overskrifter siger kan man hente flere koloner fra samme tabel med dette modul ?
Option Compare Database
Public Function Kontakt() As String
' -----------------------------------------------------------------------------------
' Purpose :
' Parameters :
' Returns : String
' Created : 15-12-2010
' Modified :
' Remarks :
' -----------------------------------------------------------------------------------
On Error GoTo Error_Kontakt
Dim result As String
Dim rst As New ADODB.Recordset
strSQL = "SELECT * FROM vis_kontakt"
rst.Open strSQL, CurrentProject.Connection, adOpenStatic, adLockOptimistic
rst.MoveFirst
While Not rst.EOF
result = result & Nz(rst!Kontakt, "") & vbCrLf
rst.MoveNext
Wend
rst.Close
Set rst = Nothing
Exit_Kontakt:
Kontakt = result
Exit Function
Error_Kontakt:
result = ""
Select Case Err.Number
Case 3021
Case 2501
Case Is < 0
Case Else
MsgBox Err.Number & ": " & Err.Description, vbOKOnly + vbCritical, "Error in procedure 'Kontakt'"
End Select
Resume Exit_Kontakt
End Function
/Lars