Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- 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
- Set oParts = window.opener.GetParts(oParts)
- Set GetParts = oParts
- Set oParts = CreateObject("ADODB.Recordset")
- oParts.Fields.Append "Part", adBSTR , 30
- oParts.Open
Add Comment
Please, Sign In to add comment