Originally Posted by
June7
I get error 3145 error twice when form opens. Not seeing 3075.
WHERE clause still has nothing in it as shown by the print in Immediate Window. You need to learn debugging. Set a breakpoint in form code then close and reopen form. Step through code, watch it execute and view content of variables.
strWhere is a global variable and its value is set in Load event but then GetRecordSource() uses global variables to set strWhere and overwrites what was set in Load event. These global variables do not have any values therefore the WHERE clause is empty and code errors.
Modify line in GetRecordSource to concatenate strWhere to itself and error goes away:
strWhere = strWhere & strPipArea & strPipPlant & strPipUnit & strPipModule & strPipEwp & strPipTracing & strPipIso _
& strEhtIso & strEhtZone & strEhtEwp & strEhtStage & strEhtTracingChck & strEhtDwgType & strLdtFluidCode
This is shown in the template database.
Do a search on GetRecordSource and see where this Sub is called. It rebuilds WHERE clause with selections in search controls.