Full Version: Refer to a specific column in a combo box from a form to use as
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
brett_hinman
I'm trying to use the 1st column of data from a combo box on a form as my criteria in a query. This is what I was trying to use but I get an error message "Undefined function".

[forms]![frmHO_UndWorksheet]![Combo58].Column(0)

Any suggestions?

Thank you in advance.

Brett Hinman
GroverParkGeorge
Perhaps this is too obvious, but is the form open when the query runs?

Another thought is that generic names like combo58 make troubleshooting more difficult than it needs to be in many cases. It's preferable to name controls to reflect their actual content. Here's how it might look.

Forms!frmHO_UndWorksheet!cboStructure.Column(0)

Finally, I assume you've placed this in the criteria row of the query, below the field name on which you want to filter the results?

George
brett_hinman
Thank you for the quick response George. I found a posting shortly after I submitted mine that said you cannot reference a column using the Forms collection. They suggested using a hidden textbox that refers to the combo box. I tried it and it works great. UA Post

Thank you again for your response.

Brett
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.