Thank you for those helpful links. I will take some time to read them.
Now regarding the real-life problem, I am trying to build a product name
field that's based on three other fields (category1, category2, size). The
category1 contains "men","women" etc, category2 contains "pants","shirts"
etc, and size contains "S","XXL" etc. I have got the NameGeneration query
worked out:
[Category1] & " " & [Category2] & " Size " & [Size]
the result displays perfectly. Then I go to the product name field in the
form, right click and set properties->row scource to NameGeneration query, it
shows a drop down menu with a list of the category1 content only. If I change
the row scource to "SELECT [Category1] & " " & [Category2] & " Size " &
[Size] FROM [abc table]" instead of the query, it shows a drop down menu with
a list of the concatenated fields, which is what I want, but I still have to
click twice to choose the right product name. And if there are so many
different kinds of category1, category2, size data (x,y,z respectively), the
list will eventually have close to x*y*z different product names for me to
choose which will be very annoying. So I was wondering if there is a way to
let the product name field have an eye on those three fields and
automatically fill itself with the concatenated result.
Hope I explained this clearly.
Thank you.
John W. Vinson said:
Press F1...
"The syntax" is more than a bit complex. I've got about three shelf feet of
books in my office describing it.
That said... you are apparently viewing Tables as if they were spreadsheets.
They're not. You should not store data in a field if that data depends on data
in other fields. Instead you can store just Field1 and Field2, and use a Query
based on the table to combine or organize them. In the query grid you can type
[Field1] & " " & [Field2]
to dynamically calculate a string consisting of the contents of Field1, a
blank, and the contents of Field2. This Query can be used as the recordsource
of a Form or Report.
Perhaps you could explain the real-life problem you're trying to solve; or you
could review some of these resources:
Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html
The Access Web resources page:
http://www.mvps.org/access/resources/index.html
Roger Carlson's tutorials, samples and tips:
http://www.rogersaccesslibrary.com/
A free tutorial written by Crystal:
http://allenbrowne.com/casu-22.html
A video how-to series by Crystal:
http://www.YouTube.com/user/LearnAccessByCrystal
MVP Allen Browne's tutorials:
http://allenbrowne.com/links.html#Tutorials