JA wrote:
Hi,
Can someone tell me if this is possible? I have 2 fields in an Access
2000 db - one is the product name, the other is the product
description. If the product name is contained in the product
description, I put bold tags around it (<b> </b>). Would it be
possible to do that with a query or some kind of expression or
something else? So that it could be done automatically. I have to go
through several 100 or 1000 new products per month!
Thanx!
Quick attempt tested on three entries with the ProductName appearing at the
beginning, middle, and end of the ProductDescription. The WHERE clause it just
to filter out rows where this has already been done before.
UPDATE Products
SET Products.ProductDescription =
Mid([ProductDescription],1,InStr(1,[ProductDescription],[ProductName])-1) &
"<b>" &
Mid([ProductDescription],InStr(1,[ProductDescription],[ProductName]),Len([ProductName]))
& "</b>" &
Mid([ProductDescription],InStr(1,[ProductDescription],[ProductName])+Len([ProductName]))
WHERE (((Products.ProductDescription) Not Like "*<b>*"));
(Please try first on a test copy of your table)
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com