Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    CTVT is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    12

    Design query in Access 2010 to search multiple fields from a single parameter input

    I have an Access 2010 DB that has multiple fields with various information in them. An example. Item 1 Item 2 Item 3 ~~~~ item 25. All the information in these fields have numerous data in them from a chrome plating shop. They could include, but not limited to, bumpers, radiators, wheels, posts, hood, valve covers, bezels, handles, brackets, grill, etc. The list is very extensive. Each record has a name, company, type of auto, or other associated with the Item 1 through Item 25 field. What I need to do is design a query so a parameter can be used as an input to search the 25 fields for any one of the items in the field. Example. What item do you need? What is name of company, customer, or type of auto associated with the part chromed. If you wanted a bumper for a 1960 chevy corvette, everything is easy to find except which field 1~25 has the word or word in a phrase = to bumper. I have tried many ways to design the query by design view or SQL and just can not get it to work properly. I have very successfully found what I needed to find the item if it is in Item 1, however is it is in item 2~item 25 I can not find it. I have tried using the same criteria on the other fields ( item 2 ~ 25) but when I do this the AND logic seems to eliminate the item I need to find. The items were not entered in any specific order when the database (Access 2000) was first set up for it. The employee might have entered a bumper as the first item one day and maybe entered a grill as the first item the next day. As a result Item 1 of one record does not line up with Item 1 of another record, however Item 5 might. The database has about 5,000 records and I do not even want to think of a redesign as I do this on a voluntary basis for my friend. Any help, examples, or other info much appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Well, the design is incorrect (not normalized). That said, if you don't want to fix it you'd have to put each field's criteria on a separate line in design view. In SQL view, that changes AND to OR.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  4. #4
    CTVT is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    12
    I did put the search criteria on separate lines. When I did that the logic fell through. I searched for a radiator on a ford car, looking for the radiator in Item 1, Item 2, etc. The results found more radiators but it also showed cars like pontiac, plymouth, etc.
    I think that is because the next line down OR looks for a radiator but does not look for only a ford. Since it found a radiator under the OR logic it put it on the screen. Only the car (ford) that had a radiator in Item 1 displayed properly. I think I have a can of worms here. Is there any way I can send you a screen shot of my logic in the database?

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You should be able to attach it here in the "Go Advanced" area. You certainly have a can of worms because of the design flaw.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    CTVT is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    12
    Quote Originally Posted by pbaldy View Post
    You should be able to attach it here in the "Go Advanced" area. You certainly have a can of worms because of the design flaw.
    Click image for larger version. 

Name:	Access query for multiple fields.png 
Views:	11 
Size:	24.6 KB 
ID:	22792
    Here is the image of how my logic in the query looks.
    Any suggestion or help much appreciated..
    Do you think there would be any easy??? way to change and modify this database to get what my friend needs?
    The problem is that each Item 1 to Item 25 field has so much different data in them. Almost a hodgepodge
    of items. However, in talking to him he states that there is no set type of item that would be stored in them.
    They have about 200-400 different types of item they receive and chrome plate. Item 1~~25 are the fields that
    store these items. It may be beyond me to figure out the best method to fix this Elephant. Customer names, companies,
    phone numbers, addresses, make, model, year, type of finish, quality, all are easy to search and manipulate. It's
    just those darn Item fields with a multitude of data that give the problem.

    Thanks for any assistance

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  8. #8
    CTVT is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    12
    Quote Originally Posted by orange View Post
    Did you look at the links I suggested?
    Yes but they did not seem to be what I was looking for.
    Thanks for your info.
    I am corresponding with another person on the forum and I think I am working my way through it.
    Again thanks.

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Personally I'd probably fix the design, but not knowing the app I can't say how involved that would be. The quick solution is to repeat the make/model/year criteria on each row where there's an item criteria. In other words, in your example they would be repeated on all 4 rows.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    CTVT is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    12
    Quote Originally Posted by pbaldy View Post
    Personally I'd probably fix the design, but not knowing the app I can't say how involved that would be. The quick solution is to repeat the make/model/year criteria on each row where there's an item criteria. In other words, in your example they would be repeated on all 4 rows.
    I tried what you suggested and it still gave me other makes than what I asked for (Ford). I don't even want to say this but I may need to redesign the whole thing. I can see tables of customers, vehicles, parts, finish, order detail, and of course they also do non-automotive plating as well. That might need a nonauto table. Then there is the matter of moving all the data from about 5000 records to a new DB. Is there a website or really good book you can recommend to help me study
    this out before I proceed? A big problem that started this was a DOS based database designed about 12 years ago that was imported into Access 2000. If I remember it only let you use one table for the database. And it would let you see only what would fit on a single screen (about a 12" monitor at the time.). No scrolling or min/max windows. Thanks for all your help and info.

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What did the query look like in design view when it did that?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    CTVT is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    12
    Quote Originally Posted by pbaldy View Post
    What did the query look like in design view when it did that?
    I attached a screen shot of how the query looked after your suggestion on the 23rd. When I ran it I got more items but also it did not limit the make to a ford.
    It found dodge, pontiac, etc. which is fine but it needs ti limit the search to the exact criteria. Access is sometimes very hard to figure in its exact logic of how
    it looks at, and in what order, when it checks criteria.
    Attached Thumbnails Attached Thumbnails Access query for J&P.png  

  13. #13
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I would expect that to work, presuming there aren't other item fields. Can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #14
    CTVT is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    12
    Quote Originally Posted by pbaldy View Post
    I would expect that to work, presuming there aren't other item fields. Can you attach the db here?
    Actually I have been checking and modifying the DB to explain to you what I am having trouble with. As I was checking through the
    various queries and forms, I could not find anything really wrong. I must have changed something that corrected a mistake.
    If you would like I can still send you the DB if you want to look at it and see if I have any serious problems (other than its overall design).
    Let me know.
    Thanks so very much for your help and advise.

  15. #15
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 22
    Last Post: 12-29-2015, 10:41 PM
  2. Multiple Date Input in Single Query
    By monsterlucifer in forum Access
    Replies: 13
    Last Post: 08-08-2015, 08:54 AM
  3. MS Access 2010 Multiple Search Form
    By tb199 in forum Access
    Replies: 17
    Last Post: 01-16-2014, 08:33 AM
  4. Replies: 1
    Last Post: 11-10-2011, 08:07 PM
  5. Replies: 1
    Last Post: 08-30-2011, 07:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums