I have some pretty length criteria entered into a query as IIf() statements and I am running out of room on the first Criteria line for some of my fields. I'd rather not use multiple criteria lines for query parameters so is there a way to tell the query to look up its criteria from a VBA source or maybe a .txt file?
I tried copying/pasting my long query criteria into VBA but I do not know the right format to put it in there and work like I need it to for my query. Here is my long query criteria for one of the fields in my query:
My issue is putting this into VBA and then having the query reference the VBA function to input the criteria. Any ideas or am I stuck using multiple query criteria parameter lines? Thanks.
I tried copying/pasting my long query criteria into VBA but I do not know the right format to put it in there and work like I need it to for my query. Here is my long query criteria for one of the fields in my query:
Code:
IIf([forms]![Query Builder Form]![Lab_Assay1]=-1,"Assay Lab #1")
Or IIf([forms]![Query Builder Form]![Lab_Assay2]=-1,"Assay Lab #2")
Or IIf([forms]![Query Builder Form]![Lab_PP-XRD]=-1,"Physical Properties/XRD")
Or IIf([forms]![Query Builder Form]![Lab_XRF-MS]=-1,"XRF/MS")
Or IIf([forms]![Query Builder Form]![Lab_XRF]=-1,"XRF")
Or IIf([forms]![Query Builder Form]![Lab_TE]=-1,"Trace Elements")
Or IIf([forms]![Query Builder Form]![Lab_SS]=-1,"Surface Science")
Or IIf([forms]![Query Builder Form]![Lab_SamP]=-1,"Sample Prep")
Or IIf([forms]![Query Builder Form]![Lab_SMMD]=-1,"Sample Management / Methods Development")
Or IIf([forms]![Query Builder Form]![Lab_RDSM]=-1,"Residue Disposition/Sample Management")
Or IIf([forms]![Query Builder Form]![Lab_RCNF]=-1,"Radiochemistry")
Or IIf([forms]![Query Builder Form]![Lab_NDA]=-1,"NDA Laboratory")
Or IIf([forms]![Query Builder Form]![Lab_MDCA]=-1,"Methods Development / Classical Analysis")
Or Like IIf([forms]![Query Builder Form]![Lab_All]=-1,"*")
My issue is putting this into VBA and then having the query reference the VBA function to input the criteria. Any ideas or am I stuck using multiple query criteria parameter lines? Thanks.