Page number URGENT!

G

GR

Hi, I need to find Labels and sub-reports in a report and
then make a table with the Label Name (or contents) and
the page number.

How can I tell Access to do this??
Example.
In the report Label lblIntroduction is in page 1,
lblService in page 1, lblCheckList in page 2, etc etc. of
course I don't know exactly where each label is!!.
So in the table (Which has two fields, fldDescription and
fldPage) I want to see after the report is ran:

Introduction 1
Service 1
Checklist 2

The code i'm working with looks like this:

Option Compare Database
Option Explicit

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim intPageCounter As Integer

Function initTable()
'Borra los numeros (anteriores) para crear nuevo indice
'On Open Report Event
Dim strSQL As String
Set db = CurrentDb()
Set rst = db.OpenRecordset("tblContents", dbOpenDynaset)
strSQL = "PageNumber <> 0"
rst.FindFirst strSQL
Do While Not rst.NoMatch
rst.Edit
rst!PageNumber = 0
rst.Update
rst.FindNext strSQL
Loop
End Function

Function UpdateTable()
'Se supone agrega los numeros.
'On Print Event Details Section
Set rst = db.OpenRecordset("tblContents", dbOpenDynaset)
rst.MoveFirst
Do While Not rst.EOF
rst.Edit
intPageCounter = Reports!rptGeneralData.Page
rst!fldPage = intPageCounter
rst.Update

rst.MoveNext
Loop
rst.Close

End Function

I am basing my code on code found in 210269 - ACC2000 but
is not helping too much..

Any ideas?? pls I have been stopped to long in this
issue.. I need urgent help!
 

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