Dumferling
Member
- Local time
- Today, 17:50
- Joined
- Apr 28, 2020
- Messages
- 102
This should work but it produces a blank form and I just can't see why. I am opening a popup form with additional information by clicking on a CommandButton. The OpenForm line looks like this: DoCmd.OpenForm "frmCOutsourcing", , , WhereCondition:="ContractID = '" & Forms!frmCContractBrowser!ID & "'"
ContractID is on the popup form and the other reference is on the main form. If I watch them they both contain the same variable (308 in this case) (ContractID is the autonumber and ID is a number field - the two underlying tables are related by these fields). The form opens fine and the condition evaluates without an error but it just opens a blank form with a "0" in the ContractID.
The underlying SQL query is:
SELECT tblCOutsourcing.ID, tblCOutsourcing.ContractID, tblCOutsourcing.FunctionOutsourced, tblCOutsourcing.OutsourceType, tblCOutsourcing.OutsourceTo, tblCOutsourcing.DateAdded
FROM tblCOutsourcing;
I have tried various permutations of this but they all end up the same way. Am I doing something obviously wrong?
ContractID is on the popup form and the other reference is on the main form. If I watch them they both contain the same variable (308 in this case) (ContractID is the autonumber and ID is a number field - the two underlying tables are related by these fields). The form opens fine and the condition evaluates without an error but it just opens a blank form with a "0" in the ContractID.
The underlying SQL query is:
SELECT tblCOutsourcing.ID, tblCOutsourcing.ContractID, tblCOutsourcing.FunctionOutsourced, tblCOutsourcing.OutsourceType, tblCOutsourcing.OutsourceTo, tblCOutsourcing.DateAdded
FROM tblCOutsourcing;
I have tried various permutations of this but they all end up the same way. Am I doing something obviously wrong?