Wildcard Critieria from a Function 
Author Message
 Wildcard Critieria from a Function

I was wondering if there was a way to set a wildcard criteria from a
function.

I can set a specific criteria from a function but not a wildcard. For
example:

Function NameCriteria()
NameCriteria = "Joe"
End Function

I then put NameCriteria() in the Name field of a query and I only get
anyone with the name of "Joe", which is what I expect. But if I want to
see everyone (by setting the criteria to *, or people  who have Joe in
their name (NameCriteria = "Joe*" ),  it doesn't work. I've tried single
quotes and other odd variations, but nothing seems to work.

Any suggestions would be greatly appreciated.

Thank you.

-Rob G.




Sun, 05 Jan 2003 03:00:00 GMT  
 Wildcard Critieria from a Function

Set the criteria line for the field in the query definition to

    Like NameCriteria()

That works for me.

--

Dirk Goldgar
(remove NOSPAM from reply address)


Quote:
> I was wondering if there was a way to set a wildcard criteria from a
> function.

> I can set a specific criteria from a function but not a wildcard. For
> example:

> Function NameCriteria()
> NameCriteria = "Joe"
> End Function

> I then put NameCriteria() in the Name field of a query and I only get
> anyone with the name of "Joe", which is what I expect. But if I want to
> see everyone (by setting the criteria to *, or people  who have Joe in
> their name (NameCriteria = "Joe*" ),  it doesn't work. I've tried single
> quotes and other odd variations, but nothing seems to work.

> Any suggestions would be greatly appreciated.

> Thank you.

> -Rob G.





Sun, 05 Jan 2003 03:00:00 GMT  
 Wildcard Critieria from a Function
Thanks!

I've been trying forever to find this solution.

This was a great help.


Quote:

> Set the criteria line for the field in the query definition to

>     Like NameCriteria()

> That works for me.

> --

> Dirk Goldgar
> (remove NOSPAM from reply address)



> > I was wondering if there was a way to set a wildcard criteria from a
> > function.

> > I can set a specific criteria from a function but not a wildcard. For
> > example:

> > Function NameCriteria()
> > NameCriteria = "Joe"
> > End Function

> > I then put NameCriteria() in the Name field of a query and I only get
> > anyone with the name of "Joe", which is what I expect. But if I want to
> > see everyone (by setting the criteria to *, or people  who have Joe in
> > their name (NameCriteria = "Joe*" ),  it doesn't work. I've tried single
> > quotes and other odd variations, but nothing seems to work.

> > Any suggestions would be greatly appreciated.

> > Thank you.

> > -Rob G.





Sun, 05 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Controlling Query Critieria With A Function

2. Find Text Function Using Wildcards

3. Like function and wildcards please help?

4. Function like InStr using wildcards?

5. Wildcard search validation (Regular Expressions)

6. DOS wildcard, *, not valid with .FileName?

7. Wildcard programming help required

8. Filecopy with wildcards

9. Embedding Wildcards in filter using VBA

10. WildCard Searches...

11. Wildcard as a parameter

12. Search in Outlook 98/2000 using wildcards in VB6

 

 
Powered by phpBB® Forum Software