I have a Form with various fields which is used to assemble a query and return results to a list box in another "Search Results" form. The user clicks/double-clicks on a result from that Form and a vb function executes to open up yet another Form using basically this code:
strWhere = "[Company.CompanyID] IN (" & strWhere & ")"
DoCmd.OpenForm FormName:="Company", WhereCondition:=strWhere
The function fails, and I'm pretty sure it is related to a data type mismatch. CompanyID is the Company table is auto-number. CompanyID is definitely available in the results listbox, and the strWhere filter is getting written properly:
[Company.CompanyID]IN ('113')
113 is the correct CompanyID coming from a click on the Results Form.
Any ideas? Thanks in advance.
strWhere = "[Company.CompanyID] IN (" & strWhere & ")"
DoCmd.OpenForm FormName:="Company", WhereCondition:=strWhere
The function fails, and I'm pretty sure it is related to a data type mismatch. CompanyID is the Company table is auto-number. CompanyID is definitely available in the results listbox, and the strWhere filter is getting written properly:
[Company.CompanyID]IN ('113')
113 is the correct CompanyID coming from a click on the Results Form.
Any ideas? Thanks in advance.