Data not visible in subreport when open from parent report (1 Viewer)

MatMac

Access Developer
Local time
Today, 03:27
Joined
Nov 6, 2003
Messages
140
Hi. I'm using the VB below to return a single value from the "Response" field of a query, (where ID number = 55, which is fed into the query through the parameter "Item"). The result is then written to a subreport unbound field "checkl55".

This works absolutely fine when I open the subreport directly. However, when I open the parent report containing the subreport, the Response value is not visible.

Having done a little test, it appears that the "On Activate" event is not triggered when the subreport is opened through the parent report.

And... for some reason I don't understand, my VB below does not work if I use the On_Open event to run it :-S

Any ideas?

*******************************
Private Sub Report_Activate()

Dim db As Database
Dim rsQuery As QueryDef
Dim rsQuerySet As Recordset
Set db = CurrentDb()
Dim ChecklResults As String

Set rsQuery = db.QueryDefs![PAAF_Checklist]
rsQuery![Forms!project!projID] = Forms![Project]![projID]
rsQuery![Item] = 55
Set rsQuerySet = rsQuery.OpenRecordset()
ChecklResults = rsQuerySet("response")
checkl55 = ChecklResults

End Sub
 

Users who are viewing this thread

Top Bottom