Referencing a sub form control from a parent form
The code below is not populating the record into the subform from a query it says too few parameters , this is supposed to be a simple thing its now frustrating, kindly see below:
The query where the data is suppose to come from
See if you can see the problem here!
Regards
Chris
Private Sub CmdGetGrns_Click()
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("QryPurchasesOrderFin", dbOpenDynaset, dbSeeChanges)
Do Until rs.EOF
Forms![frmGrn].Form![sfrmGrnDetails Subform]![PurchasesID].AddItem rs("PurchasesID")
Forms![frmGrn].Form![sfrmGrnDetails Subform]![ProductID].AddItem rs("ProductId")
Forms![frmGrn].Form![sfrmGrnDetails Subform]![Qty].AddItem rs("Quantity")
Forms![frmGrn].Form![sfrmGrnDetails Subform]![Cost].AddItem rs("CostValue")
Loop
End Sub
The query where the data is suppose to come from
SELECT tblPurchasesHeader.PurchaseID, tblPurchasesDetailslines.ProductID, tblPurchasesDetailslines.Quantity, tblPurchasesDetailslines.CostValue
FROM tblPurchasesHeader INNER JOIN tblPurchasesDetailslines ON tblPurchasesHeader.PurchaseID = tblPurchasesDetailslines.PurchaseID
WHERE (((tblPurchasesHeader.PurchaseID)=[Forms]![frmGrn]![CboOrder]));
See if you can see the problem here!
Regards
Chris
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.