Hi all,
I'm trying to populate a table field to ComboBox so that another column of the table is greater than sum of another table :
Table1 :
Table2:
="Select C_Code from Table1 where C_Amount > Dsum("D_Amount","Table2","D_Code = '" & C_Code & "'")"
If SQL Select is ran, the ComboBox items must be "A190" because >> 2600 > 150 + 500 +400
I'm running in VBA, But my SQL Select is not working and gives error, Does someone know reason of the problem?
I'm trying to populate a table field to ComboBox so that another column of the table is greater than sum of another table :
Table1 :
C_Code | C_Amount |
A190 | 2600 |
A250 | 3200 |
Table2:
D_Code | D_Amount |
A190 | 150 |
A190 | 500 |
A250 | 3250 |
A190 | 400 |
="Select C_Code from Table1 where C_Amount > Dsum("D_Amount","Table2","D_Code = '" & C_Code & "'")"
If SQL Select is ran, the ComboBox items must be "A190" because >> 2600 > 150 + 500 +400
I'm running in VBA, But my SQL Select is not working and gives error, Does someone know reason of the problem?