ComboBox.Column in a Query

modest

Registered User.
Local time
Yesterday, 20:27
Joined
Jan 4, 2005
Messages
1,220
Code:
SELECT 
    [TABLE NAME].[FILE TYPE]
FROM 
    [TABLE NAME]
WHERE 
    (
        FORMS![FORM NAME].[cboReportName].Column(3)="Report"
    )

This is basically what my rowsource of a combo box looks like. When I use it, I get the "undefined function" error. Basically this is because the querybuilder does not recognize Column as a function.

Is there any way I could get this to work in QueryBuilder. Please realize I know that I could do this in VBA, it's just that I'd like it to work in the QueryBuilder.

Thank you, Modest
 
Have you tried using the "Search" facility on this forum?
 
Ahhh the student has surpassed the teacher.

Actually, I was able to perform one search on this yesterday (which didn't yield any helpful information), but the bandwidth on my computers network must have been all used up because it was crawling. Though it took forever, I was able to read and make posts.

Today, after doing as you have suggested, I am still unable to find a solution. All the threads that I have seen are either not solved, or they are not related to my problem. The closest thread I see to my problem is here: http://www.access-programmers.co.uk/forums/showthread.php?t=75228&highlight=combobox+column+query but it has no solution either.

So Snoko, if you would like to provide an answer.. or tell me what to type in the "Search" facility... and what result to look at, I would be greatful.
 
Use the combo box's bound column as your criteria.
 
On a form you can refer to the column like this:

=[Combo].[Column](ColumnNumber)

But in a query I don't think, from memory, that this is possible. Easiest solution is to put a textbox on your form, set its ControlSource to the expression above, and then set the Visible property to False. Then just refer to the textbox in the query.
 
Thank you SJ,
It's funny, I just put an invisible text box on my form for something else, and didn't even think about using it for this. I guess it's the only workaround.

Snoko,
Thank you as well, but I'd rather not use the bound column idea because it's just giving you one solution. What if I need to include two columns? Then that solution becomes useless.


I'm curious if there is any other way to reference this column (much like the different ways to reference a form); or I'd like to make the query builder somehow recognize this function outside of VBA :)

Modest
 
Thank you SJ,
It's funny, I just put an invisible text box on my form for something else, and didn't even think about using it for this. I guess it's the only workaround.

Snoko,
Thank you as well, but I'd rather not use the bound column idea because it's just giving you one solution. What if I need to include two columns? Then that solution becomes useless.


I'm curious if there is any other way to reference this column (much like the different ways to reference a form); or I'd like to make the query builder somehow recognize this function outside of VBA :)

Modest
 

Users who are viewing this thread

Back
Top Bottom