Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using DAO to pull information into Powerpoint slide

Status
Not open for further replies.

andygmk

IS-IT--Management
Feb 10, 2003
1
GB
I have a PowerPoint presentation that I want to be able to pull data from an Access query into a slide.. Ie Visitors names for that day..

I have found some sample code (below - thanks to who wrote it!) on here which does exactly that and puts it into a message box.. However, how can I get it to fill a text box on a slide instead?

Many Thanks!
Andy

---
Pulling data from Access into another MS App (via DAO)
faq707-2281

Tested in Excel. Good Luck

Private Sub CommandButton1_Click()

'In Tools / References include "Microsoft DAO 3.51"
Dim oWorkspace As DAO.Workspace
Dim oDatabase As DAO.Database
Dim oRecordset As DAO.Recordset
Set oWorkspace = DAO.CreateWorkspace("", "admin", "", dbUseJet)
Set oDatabase = oWorkspace.OpenDatabase("c:\temp\visitor.visitor mdb")
Set oRecordset = oDatabase.OpenRecordset("qryVisitor")

oRecordset.MoveFirst
While Not oRecordset.EOF
'your code here
MsgBox (oRecordset.Fields("Accno").Value)
'ok, go next
oRecordset.MoveNext
Wend

oRecordset.Close
oDatabase.Close
oWorkspace.Close

End Sub
---
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top