Prev: Copying
Next: "is not a valid name. Make sure...
From: autigger on 15 Mar 2010 13:41 If I hard code in the following into the critera: Like [!T]* Any record that starts with T is not returned. If I pass the same thing, [!T]*, from a form to: Like [Forms]![frmTest]![Name] Nothing is returned. Why can't I pass, [!T]* from the form and get the same results as if I hardcode it into the criteria?
From: Jerry Whittle on 15 Mar 2010 13:57 When you pass it from a form, Access sees it as a string. It looks like: "[!T]*" which isn't the same thing as [!T]*. You might be able to create an SQL statement in a VBA module and get it to work correctly. -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "autigger" wrote: > If I hard code in the following into the critera: > Like [!T]* > Any record that starts with T is not returned. > If I pass the same thing, [!T]*, from a form to: > Like [Forms]![frmTest]![Name] > Nothing is returned. Why can't I pass, [!T]* from the form and get the same > results as if I hardcode it into the criteria? >
From: Jeff Boyce on 15 Mar 2010 14:57 Another possibility ... try using the Evaluate() function to see if you can persuade Access to treat what you are passing as criteria, not a string. Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "autigger" <autigger(a)discussions.microsoft.com> wrote in message news:6513CB04-3C44-49F9-925D-8F581D5FBD9E(a)microsoft.com... > If I hard code in the following into the critera: > Like [!T]* > Any record that starts with T is not returned. > If I pass the same thing, [!T]*, from a form to: > Like [Forms]![frmTest]![Name] > Nothing is returned. Why can't I pass, [!T]* from the form and get the > same > results as if I hardcode it into the criteria? >
From: John Spencer on 15 Mar 2010 17:23 That should work. Even if you enter [!T]* as criteria, it will get changed to Like "[!T]*" by the expression service So the question might be to check and see exactly what is being passed in. Put [Forms]![frmTest]![Name] in as a calculated field with no criteria where you are presently inputting the criteria and see what the query returns. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County autigger wrote: > If I hard code in the following into the critera: > Like [!T]* > Any record that starts with T is not returned. > If I pass the same thing, [!T]*, from a form to: > Like [Forms]![frmTest]![Name] > Nothing is returned. Why can't I pass, [!T]* from the form and get the same > results as if I hardcode it into the criteria? >
|
Pages: 1 Prev: Copying Next: "is not a valid name. Make sure... |