Connecting Tech Pros Worldwide Forums | Help | Site Map

Query Querstion

Chuck Insight
Guest
 
Posts: n/a
#1: Nov 13 '05
Hi All,

I need a query that allows users to enter the first three letters of a field, and list all records that match.

Thanks, Chuck


Bas Cost Budde
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Query Querstion


Add this to your SQL statement:

WHERE Left([theField],3) = [Enter the first three letters]

Or, in the design grid, start a new column, enter the expression

left(theField,3)

and put in the criteria row

[Enter the first three letters]

If you want to enter the three letters from code, or from a form, you
need a slight change. But you didn't mention the user interface.

Chuck Insight wrote:[color=blue]
> Hi All,
>
> I need a query that allows users to enter the first three letters of a
> field, and list all records that match.
>
> Thanks, Chuck
>
>[/color]

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
For human replies, replace the queue with a tea

John Welch
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Query Querstion


in the criteria box for your field, put:

Like [forms]![yourform].[controlname]

for example if it were a last name it might look like this:

like forms!mainform.txtName


"Chuck Insight" <j.gillham@insightbb.com> wrote in message
news:Judxe.108399$_o.53670@attbi_s71...
Hi All,

I need a query that allows users to enter the first three letters of a
field, and list all records that match.

Thanks, Chuck


Chuck Insight
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Query Querstion


This is the syntax I needed.

Thanks a 1,000,000
Chuck

*** Sent via Developersdex http://www.developersdex.com ***
Bas Cost Budde
Guest
 
Posts: n/a
#5: Nov 13 '05

re: Query Querstion


Like, and no '*'? Does that work?

John Welch wrote:
[color=blue]
> in the criteria box for your field, put:
>
> Like [forms]![yourform].[controlname][/color]

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
For human replies, replace the queue with a tea

Closed Thread


Similar Microsoft Access / VBA bytes