From within an html page, I create a child window to perform some filtering (choosing the printer, and what parts to print on the report). In order to show the part selection on the child window, I need to call a GetParts function from the parent window and return the recordset to the child. Here's some code to help:
From the child window->
Sub LoadParts(frmRptFilter)
Dim sql
Dim oParts
Set oParts = CreateObject("ADODB.Recordset")
oParts.Fields.Append "Part", adBSTR , 30
oParts.Open
oParts = window.opener.GetParts(oParts) 'Since oParts was passed as a parameter I did not believe this to be necessary, but when it didn't work as expected I tried returning it this way....didn't work either
'more code follows
In the Parent window ->
Function GetParts(oParts)
Dim sql
sql = "SELECT Job.Part_Number FROM Job RIGHT JOIN Packlist_Detail ON Packlist_Detail.Job = Job.Job "_
& "WHERE Packlist_Detail.Packlist LIKE '" & sPL & "'"
CloseRS(oRS)
oRS.Open sql, oConn, adOpenStatic, adLockReadOnly
oRS.MoveFirst
If Not (oRS.BOF AND oRS.EOF) Then
Do while not oRS.EOF
oParts.AddNew
oParts("Part").Value = oRS(0)
oParts.Update
oRS.MoveNext
Loop
End If
'GetParts = oParts 'Since oParts was passed as a parameter I did not believe this to be necessary, but when it didn't work as expected I tried returning it this way....didn't work either
End Function
I write reports for a software that requires me to create filter and report html pages that contain the crystal report object. The software for which I write these reports limits what I can do in terms of db connections amongst other things. So I have to things this way.
So I verified that oParts in the parent window gets filled properly. Which it does! I just can not get it filled in my child window. So the question is, How do I get a value back in the child window?