Use a recordset from a table as arguments for a function

apophis4u

New member
Local time
Yesterday, 23:25
Joined
Mar 28, 2008
Messages
5
I have been search for all day now and am unable to find sample code that uses the variables/fiels from a table as the arguments for a function in VBA.

I am creating a VBA function to put the contents of a table/ query directly in a graph object on a powerpoint slide.

For this to work a bit userfriendly I want to define the parameters in a table and use that table as input to generate the powerpoint.

My question is how I can use the complete recordset of a table and use each row to fill an individual graph on a poweropintslide

Code:
' Example input which I want to replace by the table recordset:
FillGraph "15", "S15G1", "MedeKL", "IP", "QRYKlassen", "Omvang van het kantoor"
FillGraph "16", "S16G1", "MedeKL", "", "QRYKlassenSegment", "Omvang van het kantoor"

' Which is sent into the following function
Function FillGraph(SlideNr As Integer, ShpID As String, Variabele As String, marktfilter As String, QueryFunctie As String, GraphTitle As String)

I'm really not skilled to program VBA myself, I can only recode sample code to my needs. So if someone could help me out with a really simple example, that would be great!
 
what if you filled an array with your data set then pass each row? if this would work use the "getRows" method. this method will take your query and fill an array with the results.
 
Sounds good enough, but I don't know how to write this in vba :(

Could you please give me some example code for this specific purpose?
 
Try searching google or this forum for examples on using DAO.Recordset objects. There should be tons of examples on how to use them, then it's just a matter of changing the code to suit your needs.
 

Users who are viewing this thread

Back
Top Bottom