Hello All,
If this appears twice, I apologize. I wrote first copy, wanted to edit it a bit, it disappeared. Hope I did not post it.
I have a data entry application in Access 2000 that uses a mainform/subform approach. I want to use column(5) from a combo box on the MAINFORM as a criterion in an SQL query that will be the rowsource for a combo box on the SUBFORM.
In other words, what gets chosen on mainform influences what can be chosen in the subform combo box.
Very simplified SQL conceptually is:
I have tried many variations for the criterion, such as:
All are thrown out by the SQL syntax checker. I can most likely solve this by pushing the column(5) on an after update event of the Combosource control to a hidden unbound textbox on the Mainform and then referring to the control in the SQL. But is there a direct solution using the desired column value in the SQL qurey?
Thanks in advance,
xbigblue
If this appears twice, I apologize. I wrote first copy, wanted to edit it a bit, it disappeared. Hope I did not post it.
I have a data entry application in Access 2000 that uses a mainform/subform approach. I want to use column(5) from a combo box on the MAINFORM as a criterion in an SQL query that will be the rowsource for a combo box on the SUBFORM.
In other words, what gets chosen on mainform influences what can be chosen in the subform combo box.
Very simplified SQL conceptually is:
Code:
SELECT FIELD1, FIELD2,...FIELDN
FROM TABLE1
WHERE FIELD2 = FORMS!MAINFORM!COMBOSOURCE!COLUMN(5)
ETC.
I have tried many variations for the criterion, such as:
Code:
Forms!Mainform!Combosource.Column(5)
Me.Parent.Combosource.Column(5)
Me.Parent.Mainform.Combosource.column(5)
Me![Mainform]![Combosource].[Column](5)
All are thrown out by the SQL syntax checker. I can most likely solve this by pushing the column(5) on an after update event of the Combosource control to a hidden unbound textbox on the Mainform and then referring to the control in the SQL. But is there a direct solution using the desired column value in the SQL qurey?
Thanks in advance,
xbigblue