PC Review


Reply
Thread Tools Rate Thread

doing a search using a combo box

 
 
Pete Montero
Guest
Posts: n/a
 
      10th Nov 2003
Hi what I need to do is this. I am have a database, and I
want to get information from that database into a report
so I made a combo box, I want to get information of a
part number, just by typing part of that number, not the
whole number, what is doing right now is that if I type
the beginning of a number it shows me the whole
partnumber that starts with the same number I typed in,
but I want to know if there is a way to type middle
section of a part number, and still get the information I
want for that partnumber? I really appreciate your help.
 
Reply With Quote
 
 
 
 
Tim Ferguson
Guest
Posts: n/a
 
      10th Nov 2003
"Pete Montero" <(E-Mail Removed)> wrote in
news:0a6501c3a7aa$3e061210$(E-Mail Removed):

> but I want to know if there is a way to type middle
> section of a part number, and still get the information I
> want for that partnumber?


You could use a separate textbox [txtPattern] and a listbox
[lisSearchResult]: set the rowsource for lisSearchResult to

SELECT PartNumber FROM Parts
WHERE PartNumber LIKE "*" & Forms!ThisForm!txtPattern & "*"
ORDER BY PartNumber

and use the txtPattern_Change event to call

if isnull(txtPattern) Then
' do nothing

elseif len(txtPattern) < 5 then
' do nothing if it's only a short item

else
lisSearchResult.Requery

end if

but don't expect fantastic response times, especially if the network
connection is a bit slow.

Hope that helps


Tim F

 
Reply With Quote
 
MDW
Guest
Posts: n/a
 
      10th Nov 2003
To get what you want, you may not need a combo box. Try
using an unbound text box instead. Then put the following
code behind the Click() event of a button

txtPartNumber.SetFocus
If txtPartNumber.Text <> "" Then
strWhere = "[PartNumber] LIKE '*" & txtPartNumber.Text
& "*'"

stDocName = "Your Report Name Goes Here"
DoCmd.OpenReport stDocName, acPreview, , strWhere

End If

Thus, if you typed in "PIZZA" in the box, the report could
potentially return any of the following:

PIZZAPART1
PIZZAPART2
MYPIZZA
MYPIZZAPART


>-----Original Message-----
>Hi what I need to do is this. I am have a database, and I
>want to get information from that database into a report
>so I made a combo box, I want to get information of a
>part number, just by typing part of that number, not the
>whole number, what is doing right now is that if I type
>the beginning of a number it shows me the whole
>partnumber that starts with the same number I typed in,
>but I want to know if there is a way to type middle
>section of a part number, and still get the information I
>want for that partnumber? I really appreciate your help.
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo Box - Search marf Microsoft Access 1 10th Jun 2008 11:30 PM
Combo Search Box =?Utf-8?B?YmxhZGVsb2Nr?= Microsoft Access 3 15th Mar 2007 07:08 PM
Error in my Search By - Search For Combo Boxes =?Utf-8?B?Q3VydGlzIFN0ZXZlbnM=?= Microsoft Access VBA Modules 3 9th Mar 2006 09:09 AM
Search Criteria: Two combo boxes: Issue with second combo Lance Microsoft Access Forms 0 21st Oct 2005 04:21 PM
search button to report based on multiple combo boxs ( combo criteria based upon queries ) kupppppz@gmail.com Microsoft Access Forms 6 5th Oct 2005 06:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:10 PM.