Re: Search last name and first name combo box



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



.



Relevant Pages

  • Re: Search last name and first name combo box
    ... FROM qryName; ... no move and no error message ... Then your syntax is incorrect. ... expressions when the same results can be achieved using actual field data. ...
    (microsoft.public.access.forms)
  • Re: Help with Error Handlers!!!
    ... I already knew that this syntax is incorrect. ... Bob Phillips ... Sub PasteReplaceNulls() ...
    (microsoft.public.excel.programming)
  • Re: renaming files in directory
    ... 39The syntax of the command is incorrect. ... Univ. of California, Berkeley ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: Total transactions by month
    ... > Countas Qty" (Date is the DateFieldName) and receive an error ... > message "The syntax of the subquery in this expression in incorrect". ...
    (microsoft.public.access.queries)
  • Re: Hierarchical Recordset
    ... In article, Val Mazur ... >Actually you should be careful. ... I had an experience when DE build incorrect ... >syntax for the SHAPE and it is difficult to find later. ...
    (microsoft.public.vb.general.discussion)