Re: DAP rs.find
- From: "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
- Date: Sat, 11 Nov 2021 14:37:32 -0500
You have two %. There is a difference between 'ABC%' and '%ABC%' .
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"John K" <jkraus@xxxxxxxxxxxxxx> wrote in message
news:eMwQSacBHHA.3396@xxxxxxxxxxxxxxxxxxxxxxx
Sylvain,
I looked again at the line on the page from aspxtreme that you
referenced and my line isn't the same.
Note the % is between the single quote and the double.
Here is what I have. It works just great.
Dim rs
Set rs = MSODSC.DataPages(0).Recordset.Clone
On error resume next
-->
rs.find "LastName Like '%" & Cstr(InputBox("Please enter LastName to
find", "Find")) & "%'"
--
Best Regards, John Kraus
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:uPbTZzbBHHA.3836@xxxxxxxxxxxxxxxxxxxxxxx
You're close, the final statement must look like "LastName Like
'NameToSearch%'" and where the string to search is enclosed between
single quote ' instead of double quotes " . DAP understand both % or *.
The underline symbol _ can also be used a the single replacement
character. Fore more examples, see:
http://authors.aspalliance.com/aspxtreme/ado/lettinguserssearchforinformation.aspx?pageno=4
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"John K" <jkraus@xxxxxxxxxxxxxx> wrote in message
news:etLhE$aBHHA.3836@xxxxxxxxxxxxxxxxxxxxxxx
Doug,
I had read that using 'Like' is permitted in DAP but I have no idea of
the syntax or even where to place the LIKE statement on the line. I did
read elsewhere that the % is the wildcard character. You wrote that the
'Like' itself follows the field name and that is one part of the puzzle.
I hope someone knows the syntax that follows. Does it end up something
of this sort, "LastName Like '%' '"
I have no idea of how the statement should look.
--
Best Regards, John Kraus
"Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxxx> wrote in message
news:%23$9uIkYBHHA.3928@xxxxxxxxxxxxxxxxxxxxxxx
rs.find "LastName Like '" & CStr(InputBox("Please enter LastName to
find", "Find")) & "'*"
To be honest, I've never worked with DAPs. It's possible you'll need to
use % rather than * (DAO uses * as the wildcard symbol, ADO uses %, and
I'm not sure which method DAPs use)
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"John K" <jkraus@xxxxxxxxxxxxxx> wrote in message
news:eak6DwXBHHA.5068@xxxxxxxxxxxxxxxxxxxxxxx
I have the rs.find working beautifully but want to use 'LIKE' so I
only have to enter the first three or four characters of a LastName to
retrieve the record.
rs.find "LastName = '" & CStr(InputBox("Please enter LastName to
find", "Find")) & "'"
Can someone show precisely how to modify this line using 'LIKE' so it
isn't necessary to type the entire LastName to find the record? I have
messed with this but I have no idea how to do it.
--
Best Regards, John Kraus
.
- Follow-Ups:
- Re: DAP rs.find
- From: John K
- Re: DAP rs.find
- References:
- DAP rs.find
- From: John K
- Re: DAP rs.find
- From: Douglas J. Steele
- Re: DAP rs.find
- From: John K
- Re: DAP rs.find
- From: Sylvain Lafontaine
- Re: DAP rs.find
- From: John K
- DAP rs.find
- Prev by Date: Re: DAP rs.find
- Next by Date: Re: DAP rs.find
- Previous by thread: Re: DAP rs.find
- Next by thread: Re: DAP rs.find
- Index(es):
Relevant Pages
|