criteria wild card

  • Thread starter Thread starter DeVille
  • Start date Start date
D

DeVille

Hi I have this query on my form 'MainForm' which I am
using to find a customers details by Customer name from
the 'CustomerDetailsTable' using a drop box, it works
fine but I was wondering if anyone can explain how to
write a new criteria that lets me type just a part of the
name in the text box [CustomerName] on the 'MainForm'
where I enter the search details. i.e. at the moment if I
want the name 'Fred Blogs' I have to type it out in full,
I would like to be able to just type 'Fred B' or 'Fred'
for example (note it wouldn't really suit me to break the
name into to fields) I think it might be called a wild
card, Im not sure how it works
Thanks in advance
Here is the SQL

SELECT ContactDetailsTable.*, *
FROM ContactDetailsTable
WHERE (((ContactDetailsTable.CustomerName) Like [Forms]!
[MainForm]![CustomerName]));
 
SELECT ContactDetailsTable.* FROM ContactDetailsTable
WHERE (((ContactDetailsTable.CustomerName) Like [Forms]!
[MainForm]![CustomerName] & "*"));

You 2 asterisks in your Select statement, but one was in the wrong place.
 
thanks for your help, it works well

-----Original Message-----
SELECT ContactDetailsTable.* FROM ContactDetailsTable
WHERE (((ContactDetailsTable.CustomerName) Like [Forms]!
[MainForm]![CustomerName] & "*"));

You 2 asterisks in your Select statement, but one was in the wrong place.
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


DeVille said:
Hi I have this query on my form 'MainForm' which I am
using to find a customers details by Customer name from
the 'CustomerDetailsTable' using a drop box, it works
fine but I was wondering if anyone can explain how to
write a new criteria that lets me type just a part of the
name in the text box [CustomerName] on the 'MainForm'
where I enter the search details. i.e. at the moment if I
want the name 'Fred Blogs' I have to type it out in full,
I would like to be able to just type 'Fred B' or 'Fred'
for example (note it wouldn't really suit me to break the
name into to fields) I think it might be called a wild
card, Im not sure how it works
Thanks in advance
Here is the SQL

SELECT ContactDetailsTable.*, *
FROM ContactDetailsTable
WHERE (((ContactDetailsTable.CustomerName) Like [Forms]!
[MainForm]![CustomerName]));


.
 
I used this to fix a query I was wanting to work like
this. Thank you for posting it. I used this in my query,
but I can't get the form to work properly. I am wanting
my form to load all records that has the search criteria
typed in the "Name" field, and then be able to scroll to
find the name we are searching for. Thanks in advance.
Here is the SQL:
SELECT Membership.Name, Membership.Memnum,
Membership.Addr1, Membership.Addr2, Membership.
[City/State], Membership.Zip
FROM Membership
WHERE (((Membership.Name) Like [Forms]!
[F_Find_Member_Name]![Name] & "*"));
 
Back
Top