Make the following table in your database
*RptPages*
Hospital, text
FirstPage, integer
LastPage, integer
make a unique index on Hospital
NOTE: Even better to use HospitalID if you have it
On your report, make the following textbox control:
Name--> PageNo
controlSource --> =Page
in the ReportHeader section OnFormat event, clear records
that were already in the RptPages table
dim s as string
s = "DELETE * FROM RptPages;"
currentdb.execute s
currentdb.tabledefs.refresh
DoEvents
then, in the OnFormat event of each horpital group header
section
dim s as string
s = "INSERT INTO RptPages " _
& " (Hospital, FirstPage) "
& " SELECT '" & me.hospital_controlname _
& "', " & me.pageNo & ";"
currentdb.execute s
currentdb.tabledefs.refresh
DoEvents
then, in the OnFormat event of each horpital group footer
section
dim s as string
s = "UPDATE RptPages " _
& " SET LastPage = "
& me.pageNo _
& " WHERE Hospital ='" _
& me.hospital & "';"
currentdb.execute s
currentdb.tabledefs.refresh
DoEvents
Now your table will be populated when you get to the report
footer...
Warm Regards,
Crystal
Microsoft Access MVP 2006
*
Have an awesome day ;)
remote programming and training
strive4peace2006 at yahoo.com
*
> Hi Mchel,
> Thanks for your reply,
[quoted text clipped - 35 lines]
>>
>>>Dean
ielmrani - 15 Jun 2006 22:33 GMT
Sorry to reply this late, but I had no idea you replied. To honest with you
I gave up on this issue. I'll try your suggestion and I'll let you know.
Thanks
Ismail
>Make the following table in your database
>
[quoted text clipped - 65 lines]
>>>
>>>>Dean
ielmrani - 16 Jun 2006 16:07 GMT
Worked. You're genius. Thank you very much.
Ismail
>Make the following table in your database
>
[quoted text clipped - 65 lines]
>>>
>>>>Dean
strive4peace - 16 Jun 2006 17:33 GMT
you're welcome, Ismail ;) happy to help
Warm Regards,
Crystal
Microsoft Access MVP 2006
*
Have an awesome day ;)
remote programming and training
strive4peace2006 at yahoo.com
*
> Worked. You're genius. Thank you very much.
> Ismail
[quoted text clipped - 69 lines]
>>
>>>>>Dean