Re: Search last name and first name combo box
- From: "Song Su" <csitnnn@xxxxxxxxxxx>
- Date: Sun, 29 Jul 2007 07:35:44 -0700
Hi Rick,
Thank you for fast reply. My table has about 1000 records. I really like to
use your method. You said my syntax is incorrect. which part? can you help
me to correct my syntax to be used in your method?
Thanks.
"Rick Brandt" <rickbrandt2@xxxxxxxxxxx> wrote in message
news:Fy0ri.24880$RX.9731@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"Song Su" <csitnnn@xxxxxxxxxxx> wrote in message
news:e$xxbIe0HHA.5764@xxxxxxxxxxxxxxxxxxxxxxx
Rick,
I tried your method.
column count 3, column width 0;0;1 (hide first 2 columns)
rowsource SELECT qryName.[Last Name], qryName.[First Name], [Last Name] &
", " & [First Name] AS Expr1
FROM qryName;
The problem is rs.FindFirst does not find. no move and no error message
Then your syntax is incorrect.
If I use column count 1, column width 1
rowsource SELECT [Last Name] & [First Name] AS Expr1
FROM qryName;
rs.FindFirst "[Last Name]&[First Name] = '" & Me![cboFind] & "'"
works fine but user see last name and first name combined in the find
box.
I want to know if I use SELECT [Last Name] & ", " & [First Name] AS Expr1
FROM qryName
and how to modify rsFindFirst before = part
rs.FindFirst "[Last Name] & ', ' & [First Name] = '" & Me![cboFind] & "'"
BUT...you are now searching on an expression rather than on raw field data
which is MUCH less efficient as no index can be used. You force the
search to perform a full scan of the RecordSet performing the expression
evaluation on each row as it goes.
This might not be a big deal depending on the size of your table and other
factors, but as a general practice you don't want to filter or search on
expressions when the same results can be achieved using actual field data.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
.
- Follow-Ups:
- Re: Search last name and first name combo box
- From: Rick Brandt
- Re: Search last name and first name combo box
- References:
- Search last name and first name combo box
- From: Song Su
- Re: Search last name and first name combo box
- From: Song Su
- Re: Search last name and first name combo box
- From: Rick Brandt
- Re: Search last name and first name combo box
- From: Song Su
- Re: Search last name and first name combo box
- From: Rick Brandt
- Search last name and first name combo box
- Prev by Date: Re: Search last name and first name combo box
- Next by Date: Re: Search last name and first name combo box
- Previous by thread: Re: Search last name and first name combo box
- Next by thread: Re: Search last name and first name combo box
- Index(es):
Relevant Pages
|