J
JohnE
I have a main form with a subform on it. the subform is continuous. At the
end of each row is a small button that opens a popup form. What I need to do
is take info and fill the popup with info relating to the subform row. I am
unsure of how to do it. Here is the popup form load that I have sofar;
Private Sub Form_Load()
Dim sql As String
Dim rst As Recordset
sql = "SELECT InventoryLots.ID, InventoryLotsQ.ID AS LotsQID,
InventoryLotsQ.LotNumber, InventoryLotsQ.PartNumber, InventoryLotsQ.Revision,
InventoryLotsQ.Location, InventoryLotsQ.POChargeAccount,
InventoryLotsQ.Quantity, InventoryLots.MaterialValuePerUnit,
InventoryLots.LaborValuePerUnit"
sql = sql & " FROM InventoryLots INNER JOIN InventoryLotsQ ON
InventoryLots.ID = InventoryLotsQ.ID"
'sql = sql & " WHERE (((InventoryLots.ID)=[InventoryLotsQ].[ID]))"
Set rst = CurrentDb.OpenRecordset(sql)
rst!ID = ID
rst!LotNumber = LotSerialNumber
rst!PartNumber = PartNumber
rst!Revision = Revision
rst!Location = Location
rst!POChargeAccount = ChargeAccountJobNumber
rst!Quantity = Quantity
rst!MaterialValuePerUnit = MaterialValuePerUnit
rst!LaborValuePerUnit = LaborValuePerUnit
End Sub
You'll notice the WHERE clause is commented out. Reason being is that in
the button's click event opening the popup is this line;
DoCmd.OpenForm "zPartPriceUpdate", , , "ID=" & Me.ID
The popup was originally bound so the WHERE was placed in here but now it
cannot be and needs to have the info placed into the popup. The information
going into the popup is filtered by the ID field on the subform.
I need help in getting this to work properly. Can someone review and see
what is wrong or what I need to do?
Thanks... John
end of each row is a small button that opens a popup form. What I need to do
is take info and fill the popup with info relating to the subform row. I am
unsure of how to do it. Here is the popup form load that I have sofar;
Private Sub Form_Load()
Dim sql As String
Dim rst As Recordset
sql = "SELECT InventoryLots.ID, InventoryLotsQ.ID AS LotsQID,
InventoryLotsQ.LotNumber, InventoryLotsQ.PartNumber, InventoryLotsQ.Revision,
InventoryLotsQ.Location, InventoryLotsQ.POChargeAccount,
InventoryLotsQ.Quantity, InventoryLots.MaterialValuePerUnit,
InventoryLots.LaborValuePerUnit"
sql = sql & " FROM InventoryLots INNER JOIN InventoryLotsQ ON
InventoryLots.ID = InventoryLotsQ.ID"
'sql = sql & " WHERE (((InventoryLots.ID)=[InventoryLotsQ].[ID]))"
Set rst = CurrentDb.OpenRecordset(sql)
rst!ID = ID
rst!LotNumber = LotSerialNumber
rst!PartNumber = PartNumber
rst!Revision = Revision
rst!Location = Location
rst!POChargeAccount = ChargeAccountJobNumber
rst!Quantity = Quantity
rst!MaterialValuePerUnit = MaterialValuePerUnit
rst!LaborValuePerUnit = LaborValuePerUnit
End Sub
You'll notice the WHERE clause is commented out. Reason being is that in
the button's click event opening the popup is this line;
DoCmd.OpenForm "zPartPriceUpdate", , , "ID=" & Me.ID
The popup was originally bound so the WHERE was placed in here but now it
cannot be and needs to have the info placed into the popup. The information
going into the popup is filtered by the ID field on the subform.
I need help in getting this to work properly. Can someone review and see
what is wrong or what I need to do?
Thanks... John