query based on text box value

  • Thread starter Thread starter eb1mom
  • Start date Start date
E

eb1mom

I have a form with combobox to retrieve record. This record
is displayed in text boxes. I am attempting to create a
query from value in text box 1. I have another group of
records with 15 fields per record. I would like the query
to return all records that have "value in text box 1" in
any of the 15 fields. The "value in text box 1" could be in
only one field but, might be in all fields. I am hoping to
base a combobox on the results of this query. Is there
possibly an example somewhere that I could look at? Thanks
 
If you have a table design in which a given value might show up in any of 15
fields, consider stepping back for a bit and looking into normalization.
I'm not saying that every time a database has multiple fields holding the
same kind of information, there's a problem with data structure, but it does
seem to suggest this.

Your queries would be much easier, and you would use Access' strengths with
less work and headache if you had a single field that might contain your
search value, rather than 15.
 
The table I need to query holds lathe post/cut information.
Wooden posts with fifteen lathe cuts per post. Each post
has fifteen cut postions each cut could be a different
pattern or all the same. Examples-Post 1 has fifteen
pattern five cuts, post 2 has fifteen pattern four cuts,
post 3 has five pattern one cuts, five pattern two cuts and
five pattern four cuts. Query would return all posts
containing a "selected pattern #". I don't think I am
storing same information twice. Any suggestions?
 
From your description, "post 3" and "post 2" each use "pattern four" cuts.
This seems like a duplication to me.

Without a look at your table structure, it will be a bit difficult to
diagnose/recommend.

Your original post alluded to 15 fields, and sounded like there could be
repeating data (since you wanted to search all 15 for the occurrence of
"something").

More info, please...

Jeff Boyce
<Access MVP>
 
More information:
Table is set up to store which pattern cuts are made to
which posts.
One record might look like this.
Field
postname: post1
cut1: pattern4
cut2: pattern5
cut3: pattern8
cut4: pattern1
cut5: pattern2
cut6: pattern11
cut7: pattern2
cut8: pattern3
cut9: pattern4
cut10: pattern4
cut11: pattern6
cut12: pattern8
cut13: pattern9
cut14: pattern10
cut15: pattern12
There are over 100 "posts" and 100 "patterns" that could be
cut in any combination on each post. Thanks for looking at
my post again.
 
More information:
Table is set up to store which pattern cuts are made to
which posts.
One record might look like this.
Field
postname: post1
cut1: pattern4
cut2: pattern5
cut3: pattern8
cut4: pattern1
cut5: pattern2
cut6: pattern11
cut7: pattern2
cut8: pattern3
cut9: pattern4
cut10: pattern4
cut11: pattern6
cut12: pattern8
cut13: pattern9
cut14: pattern10
cut15: pattern12
There are over 100 "posts" and 100 "patterns" that could be
cut in any combination on each post. Thanks for looking at
my post again.

You really should reconsider your table structure. This is a
"spreadsheet" style table - wide not deep. Any time you have fields
named Cut1, Cut2, ... Cut15 your table structure IS WRONG - it
violates second normal form, to be technical!

A much better design would be to split this into as many records as
you have cuts: e.g.

Postname
Cut
Pattern

with records

Post1; 1; "Pattern4"
Post1; 2; "Pattern5"
Post1; 3; "Pattern8"
....
 
What a mess, I am headed back to the drawing board with
this old database.Thanks for the enlightening information.
 
Back
Top