Question : Query criteria

Hi Experts,

I have a query consisting of linked tables. If i set the query criteria of M_REFERENCE to 9C1BC11/1/BD08 then query runs and returns results within 4 seconds.

But if I set the criteria to [Mod Reference] then enter 9C1BC11/1/BD08 into the parameter msgbox then the query will run for over 3 minutes until I break out of it.

Why does this happen? I want the user to input the M_REFERNCE in this way.

Many Thanks,
Deano

Answer : Query criteria

Have you explicitly declared the [Mod Reference] parameter as text.  If not, modify the query to include that line, which preceeds your SQL string

PARAMETERS [Mod Reference] Text ( 255 );

To do this from the query grid, right click in the upper portion of the grid and select the Parameters option from the popup window.  Then, in the grid, enter your parameter "[Mod Reference]" (without the quotes) and select the text datatype.
Random Solutions  
 
programming4us programming4us