Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Running query for invoices that start with #5???

Geek News

Running query for invoices that start with #5???
"mugziegumz via AccessMonster.com" <u47747[ at ]uwe> 12/10/2008 3:41:39 PM
How do I create a query that will look up multiple invoices that start with
the number 5? When I type in criteria "5" nothing shows up even though I know
I have plenty.....thanks.
Shannon

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200812/1

Re: Running query for invoices that start with #5???
Marshall Barton <marshbarton[ at ]wowway.com> 12/10/2008 3:57:05 PM
mugziegumz via AccessMonster.com wrote:

[Quoted Text]
>How do I create a query that will look up multiple invoices that start with
>the number 5? When I type in criteria "5" nothing shows up even though I know
>I have plenty


What type of field contains these invoice numbers?

If it's an Integer or Long field, then you can use the
criteria:
Like "5*"

If it's a Text field, you can try the same thing unless the
field has leading spaces, zeros, or something else.

--
Marsh
MVP [MS Access]
Re: Running query for invoices that start with #5???
"mugziegumz via AccessMonster.com" <u47747[ at ]uwe> 12/10/2008 4:05:50 PM
Thank you so much. Exactly what I needed. Being brand new with access is
tough!

Marshall Barton wrote:
[Quoted Text]
>>How do I create a query that will look up multiple invoices that start with
>>the number 5? When I type in criteria "5" nothing shows up even though I know
>>I have plenty
>
>What type of field contains these invoice numbers?
>
>If it's an Integer or Long field, then you can use the
>criteria:
> Like "5*"
>
>If it's a Text field, you can try the same thing unless the
>field has leading spaces, zeros, or something else.
>

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200812/1

Re: Running query for invoices that start with #5???
"mugziegumz via AccessMonster.com" <u47747[ at ]uwe> 12/10/2008 4:11:51 PM
One more question...
Here are examples of invoices:
11595550
145390
18375
2101931
212864
5g8509
5g8886
All invoice are sporadic. If I wanted to create a query and save it to go
into whenever and do a search for all invoices with a 1, or all invoices that
start with G...how do I create a query where it is simple to open it, type in
what I'm looking for and get the details. Or do I have to go in to the query
each time, click design button and change my search to whatever I'm looking
for?

mugziegumz wrote:
[Quoted Text]
>Thank you so much. Exactly what I needed. Being brand new with access is
>tough!
>
>>>How do I create a query that will look up multiple invoices that start with
>>>the number 5? When I type in criteria "5" nothing shows up even though I know
>[quoted text clipped - 8 lines]
>>If it's a Text field, you can try the same thing unless the
>>field has leading spaces, zeros, or something else.

--
Message posted via http://www.accessmonster.com

Re: Running query for invoices that start with #5???
Marshall Barton <marshbarton[ at ]wowway.com> 12/10/2008 5:34:33 PM
mugziegumz via AccessMonster.com wrote:

[Quoted Text]
>One more question...
>Here are examples of invoices:
>11595550
>145390
>18375
>2101931
>212864
>5g8509
>5g8886
>All invoice are sporadic. If I wanted to create a query and save it to go
>into whenever and do a search for all invoices with a 1, or all invoices that
>start with G...how do I create a query where it is simple to open it, type in
>what I'm looking for and get the details. Or do I have to go in to the query
>each time, click design button and change my search to whatever I'm looking
>for?


A quick and dirty way is to set the criteia to:
Like [Enter first character] & "*"

A better way would be to create a form with a text box where
you can enter the first character and a button to open the
query (the button wizard can create the code for you). In
this case the criteria would be:
Like Forms![form name].[text box name] & "*"

An even better way is avoid displaying a query (where users,
including yourself, can easily mutilate the data) by using a
continuous form to display the records. In this scenario,
the text box would be in the form's header section and the
criteria could be either as in the second scenario. Since
this does not use a button, you woll need a line of code in
the text box's AfterUpdate event procedure:
Me.Requery

--
Marsh
MVP [MS Access]
Re: Running query for invoices that start with #5???
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 12/10/2008 6:30:54 PM
Marshall Barton wrote:
[Quoted Text]
> mugziegumz via AccessMonster.com wrote:
>
>> One more question...
>> Here are examples of invoices:
>> 11595550
>> 145390
>> 18375
>> 2101931
>> 212864
>> 5g8509
>> 5g8886
>> All invoice are sporadic. If I wanted to create a query and save it
>> to go into whenever and do a search for all invoices with a 1, or
>> all invoices that start with G...how do I create a query where it is
>> simple to open it, type in what I'm looking for and get the details.
>> Or do I have to go in to the query each time, click design button
>> and change my search to whatever I'm looking for?
>
>
> A quick and dirty way is to set the criteia to:
> Like [Enter first character] & "*"
>
> A better way would be to create a form with a text box where
> you can enter the first character and a button to open the
> query (the button wizard can create the code for you). In
> this case the criteria would be:
> Like Forms![form name].[text box name] & "*"
>
> An even better way is avoid displaying a query (where users,
> including yourself, can easily mutilate the data) by using a
> continuous form to display the records. In this scenario,
> the text box would be in the form's header section and the
> criteria could be either as in the second scenario. Since
> this does not use a button, you woll need a line of code in
> the text box's AfterUpdate event procedure:
> Me.Requery

This does not answer the question you asked but a combo box sorted on teh
invoice number would allow this.


Re: Running query for invoices that start with #5???
"mugziegumz via AccessMonster.com" <u47747[ at ]uwe> 12/10/2008 6:57:05 PM
So if I had 3,000 invoices and wanted to find all starting with a 5.......how
is a combo box useful?

Mike Painter wrote:
[Quoted Text]
>>> One more question...
>>> Here are examples of invoices:
>[quoted text clipped - 29 lines]
>> the text box's AfterUpdate event procedure:
>> Me.Requery
>
>This does not answer the question you asked but a combo box sorted on teh
>invoice number would allow this.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200812/1

Re: Running query for invoices that start with #5???
"mugziegumz via AccessMonster.com" <u47747[ at ]uwe> 12/10/2008 7:20:57 PM
I figured it out. This is what I wanted. Thank you Marshall Barton. The first
command worked perfect.

Marshall Barton wrote:
[Quoted Text]
>>One more question...
>>Here are examples of invoices:
>[quoted text clipped - 11 lines]
>>each time, click design button and change my search to whatever I'm looking
>>for?
>
>A quick and dirty way is to set the criteia to:
> Like [Enter first character] & "*"
>
>A better way would be to create a form with a text box where
>you can enter the first character and a button to open the
>query (the button wizard can create the code for you). In
>this case the criteria would be:
> Like Forms![form name].[text box name] & "*"
>
>An even better way is avoid displaying a query (where users,
>including yourself, can easily mutilate the data) by using a
>continuous form to display the records. In this scenario,
>the text box would be in the form's header section and the
>criteria could be either as in the second scenario. Since
>this does not use a button, you woll need a line of code in
>the text box's AfterUpdate event procedure:
> Me.Requery
>

--
Message posted via http://www.accessmonster.com

Re: Running query for invoices that start with #5???
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 12/10/2008 11:56:22 PM
mugziegumz via AccessMonster.com wrote:
[Quoted Text]
> So if I had 3,000 invoices and wanted to find all starting with a
> 5.......how is a combo box useful?

None if that is all you wanted to do. Usually there is a reason for finding
a set of things.
If it is just to print a list, even with just a few more details then the
other solutions would work.

>
> Mike Painter wrote:
>>>> One more question...
>>>> Here are examples of invoices:
>> [quoted text clipped - 29 lines]
>>> the text box's AfterUpdate event procedure:
>>> Me.Requery
>>
>> This does not answer the question you asked but a combo box sorted
>> on teh invoice number would allow this.


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net