Some of this depends on the data type of CUST_ID. If it is numeric:
Code:
Dim strWhere as String
strWhere = "[CUST_ID] = " & Forms![FRM_SRCH]![lstSearch]
DoCmd.OpenForm "customer_old", , , strWhere
If it is text
Code:
Dim strWhere as String
strWhere = "[CUST_ID] = """ & Forms![FRM_SRCH]![lstSearch] & """"
DoCmd.OpenForm "customer_old", , , strWhere
If the code is running in the form "FRM_SRCH" then
Code:
Dim strWhere as String
strWhere = "[CUST_ID] = """ & Me![lstSearch] & """"
DoCmd.OpenForm "customer_old", , , strWhere
Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.