0
votes

I have two tables named "REPORTS" and "REPORT_NAMES". In REPORTS there are 2 columns "REPORT_NAME" and "DATE". In REPORT_NAMES there is only "REPORT_NAME" column. I created a combo box and a button in a form. All I want to do is when I choose a report from the combo box and hit the "RUN" button, "Query1" is to be run. "Query1" is like below;

SELECT * FROM REPORTS WHERE (((REPORTS.REPORT_NAME) = [Forms]![Form1]![REPORT_NAME_Label])); 

But when I choose a report from the combo box and hit the run button query runs but gives a blank datasheet.

1
I typed the wrong table's name, sorry. It is "REPORTS". - Ogan
When I run the query in the Immediate window it says "Error 438 Object Doesn't Support This Property or Method" - Ogan
Is [Forms]![Form1]![REPORT_NAME_Label] the actual combo box or is it the combo box's label? If it's the label then you should change that bit to the name of actual combo box - Matt Hall
Thank you very much, changing label to combo box worked. But I had tried it before and gave me the blank datasheet. - Ogan

1 Answers

0
votes

It should be [Forms]![Form1]![REPORT_NAME] which is the combo box instead of [Forms]![Form1]![REPORT_NAME_Label] which is the label.