Transfer data from Access to PowerPoint

  • Thread starter biganthony via AccessMonster.com
  • Start date
B

biganthony via AccessMonster.com

Hi,

I found this code on Microsoft's website for transferring data from a table
to a PowerPoint file.

Out of curiosity, I was wondering how to get it to display four fields from a
record on each slide, instead of the one that it shows below. Currently, it
displays the EmployeeCode on separate slides. I would like to know how to get
it to show, EmployeeCode, EmployeeFirst, EmployeeSurname and EmployeePosition.



Dim db As Database, rs As Recordset
Dim ppObj As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation

'Open up a recordset on the Employees table.
Set db = CurrentDb
Set rs = db.OpenRecordset("Employees", dbOpenDynaset)

'Open up an instance of Powerpoint.
Set ppObj = New PowerPoint.Application
Set ppPres = ppObj.Presentations.Add

'Setup the set of slides and populate them with data from the
'set of records.
With ppPres
While Not rs.EOF
With .Slides.Add(rs.AbsolutePosition + 1, ppLayoutTitle)
.Shapes(1).TextFrame.TextRange.Text = "Hi! Page " & rs.
AbsolutePosition + 1
.SlideShowTransition.EntryEffect = ppEffectFade
With .Shapes(2).TextFrame.TextRange
.Text = CStr(rs.Fields("EmployeeCode").value)
.Characters.Font.Color.RGB = RGB(255, 0, 255)
.Characters.Font.Shadow = True
End With
.Shapes(1).TextFrame.TextRange.Characters.Font.Size = 50
End With
rs.MoveNext
Wend
End With

' Run the show.
ppPres.SlideShowSettings.Run

Many thanks,
Anthony
 
N

nathan_savidge

Try this

this line
..Text = CStr(rs.Fields("EmployeeCode").value)

needs to have the extra fields on, i.e

..Text = CStr(rs.Fields("EmployeeCode").value) & chr(32) & .Text =
CStr(rs.Fields("EmployeeSalary").value) and so on.
 
N

nathan_savidge

Sorry,

..Text = CStr(rs.Fields("EmployeeCode").value) &
CStr(rs.Fields("EmployeeCode").value)

LIKE THIS.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top