I use an Access database to basically take data exports, import them,
manipulate the data, and then turn them into exportable reports. I do
this using numerous macros, and queries to get the data in the format
that I need it in order to create the reports that we use. So far this
has proven to be successful for the reports that I am doing and the
data that I am pulling into it. I just have one challenge that may
require a lot of work and I wanted to find out if there was a possible
way to save time and a lot of effort on this.
I basically need to create either a query or macro that will look in
one table and basically do a mass find and replace on one particular
field based on the data in that field. I then want it to look to
another table (basically a definitions table) and replace what it
finds in the first table with the value from the definitions table. I
want to be able to do this because the field that I want to report off
of contains the product name but also more details that are useless
for this type of report.
Example:
Table1
[Product Details]
MS Word printing problem
MS Word formatting issue
MS Outlook email address book
Word 97 upgrade
Access 2002
Table2 – Definitions table
[Product Name] [Replace with]
(if found) (replace with)
word MS Word
outlook MS Outlook
access MS Access
Basically what I hope to achieve is, if the query finds Word in the
field, no matter what comes before or after it, it will replace the
entire contents of the field with MS Word. I know this can be done
manually with a find and replace or an update query, but I was
thinking that there is a way to build this definitions table and have
the query look at this table to find out what to replace the field
with depending on what it finds in the first table (Table1). I hope to
have it process about 800 records replacing the field contents with
what it finds in the definitions table. This should allow me to add
new products as time goes on as well.
The alternative that I have found for this so far, which is time
consuming and makes the database bulky, is to make 1 update query for
each product that might be listed in the table, using *word* and
updating it to "MS WORD". I then place each query in a macro and the
process runs. I have this linked to another table that has all of the
product names in the correct format (MS WORD), and use a select query
to display this on the report. Another downfall is, if new products
are added later on, they have to be entered into the table and also
must have a macro created for them. I eventually want to get this to
the point were generally end users can manage this as needed.
Any assistance or ideas on this would be greatly appreciated.
Thank you in advance.
DM266Skip