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
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