padlocked17
Registered User.
- Local time
- Today, 06:15
- Joined
- Aug 29, 2007
- Messages
- 275
All -
I have a query that generates info that I'm using to create a powerpoint presentation (Automated that is).
As you can see below I'm using some info in the query to determine how many people fit the criteria. I then check to see if anyone meets the requirements. If they do, a slide is created.
What I need to do is say, if records exist, for the first 12, create a slide and if there are still more people that meet the criteria, create another slide where we left off for the next 12 people and so on.
I could really use some help on this one. Should be pretty basic, but I'm drawing a blank.
I have a query that generates info that I'm using to create a powerpoint presentation (Automated that is).
As you can see below I'm using some info in the query to determine how many people fit the criteria. I then check to see if anyone meets the requirements. If they do, a slide is created.
What I need to do is say, if records exist, for the first 12, create a slide and if there are still more people that meet the criteria, create another slide where we left off for the next 12 people and so on.
I could really use some help on this one. Should be pretty basic, but I'm drawing a blank.
Code:
'define data for slide
Set rs = CurrentDb.OpenRecordset("SELECT * from qryPermPartyExport WHERE Months <= 1")
'rs.MoveFirst
If rs.RecordCount > 0 Then
'Now that we know records exist, we need to limit it to 12 records and then create a new slide
rs.MoveFirst
'there are persons for this slide
'create slide
InsertSlide ppPres, x, "PP"
With .Slides(x)
'layout titles
' [REMOVED ALL SLIDE CODE]
'insert data
' [REMOVED ALL SLIDE CODE]
y = 3
Do While Not rs.EOF 'as long as there is another person
y = y + 1 'move to the next row
rs.MoveNext 'move to next person
Loop
End With
x = x + 1
End If
'close dataset for 1st slide
rs.Close