H
Home
Hello,
i am using access for a long time now and i run into its limitations so now
i try to use dao. This seems to be a very logical language. One problem, how
can i put the results of my functions in my forms / reports. I assume it's
not something you put in your record source. For example, i have:
Function test() As Variant
Dim dbDatabase As DAO.Database
Dim dtRecord As DAO.Recordset
Set dbDatabase = CurrentDb()
Set dtRecord = dbDatabase.OpenRecordset("tblKlantKort", dbOpenDynaset)
dtRecord.MoveFirst
Do Until dtRecord.EOF
Debug.Print dtRecord![Klant-id]
Debug.Print dtRecord!Naam
Debug.Print dtRecord!Woonplaats
Debug.Print dtRecord!Telefoon
Debug.Print dtRecord!Email
dtRecord.MoveNext
Loop
dtRecord.Close
dbDatabase.Close
End Function
When i execute this, i get to see the records form my vba results window.
How can i manage that when i open a form, these results display immediate?
Thanks!
Rogier
i am using access for a long time now and i run into its limitations so now
i try to use dao. This seems to be a very logical language. One problem, how
can i put the results of my functions in my forms / reports. I assume it's
not something you put in your record source. For example, i have:
Function test() As Variant
Dim dbDatabase As DAO.Database
Dim dtRecord As DAO.Recordset
Set dbDatabase = CurrentDb()
Set dtRecord = dbDatabase.OpenRecordset("tblKlantKort", dbOpenDynaset)
dtRecord.MoveFirst
Do Until dtRecord.EOF
Debug.Print dtRecord![Klant-id]
Debug.Print dtRecord!Naam
Debug.Print dtRecord!Woonplaats
Debug.Print dtRecord!Telefoon
Debug.Print dtRecord!Email
dtRecord.MoveNext
Loop
dtRecord.Close
dbDatabase.Close
End Function
When i execute this, i get to see the records form my vba results window.
How can i manage that when i open a form, these results display immediate?
Thanks!
Rogier