I'm making a search form for keyword searches. I have comboboxes with values ["And","Or","Not"], comboboxes with a list of field names, e.g. ["Title","Description",...] and textboxes associated with each combobox. I'm trying to create the sql query based on the values of the comboboxes and text box. To do that, I need to refer to the field name based on the value of the combobox. I'm trying solutions I've found searching, but I'm still getting the error: "Compile error: Sub or Function not defined". The debugger highlights "VHS_Metadata_Aug52014(field)" in yellow.
.....
bool_type = Me!Controls!dropBoolType2.value
field = Me!Controls!dropSearch2.value
value = Me!Controls!txtKeywords2.value
If (value) > 0 Then
SQL_query_string = SQL_query_string & " " & bool_type & " " & VHS_Metadata_Aug52014(field) = " & value"
End If
.....
VHS_Metadata_Aug52014? The syntax:VHS_Metadata_Aug52014()is that of a function.