I have a form with a combo box on it. The combo is bound to the first column which is FacilityID. The combo displays the second column which is FacilityName. I am creating a search form, and I want the user to be able to search on FacilityName. I've looked around here and found where someone suggested creating a text box whose control source is the second column of the combo box, as in =FacilityID.Column(1). I did this and created a field called txtFacility, and it displays the data correctly. The problem is that I can't figure out how to perform a find from the search form. I keep getting an error message saying that "The Microsoft Jet database engine does not recognize txtFacility as a valid field name or expression."
Here's the code that's giving me problems. It is in the search button of the search form where frmFacilities is the form I'm trying to search:
Forms!frmFacilities.Form.Recordset.FindFirst "[txtFacility] = '" & me.txtSearchName & "'"
Can anyone help with this?
Here's the code that's giving me problems. It is in the search button of the search form where frmFacilities is the form I'm trying to search:
Forms!frmFacilities.Form.Recordset.FindFirst "[txtFacility] = '" & me.txtSearchName & "'"
Can anyone help with this?