Update/insert or append?

R

Robbie

I have about a 100 records that need to have a disclaimer added to their
description.

The disclaimer is the same. Basically it just says the product is not
released yet and it is expected on X date.

I don't want to replace the existing description so I want to know how to
add that sentence at the beginning of the field on those records.

My design view is somewhat like this
Table: Products

Fields: ItemNo | ReleaseDate | Description

I have criteria in the release date. >#2/1/2009#

I just don't know how to add the text. I'm familiar with basic update
queries but I don't want to replace the existing text, I just want to add to
the beginning of it. I've never done insert or append, not sure how to do
those or how they work.
 
S

strive4peace

Hi Robbie,

firstly, do not use DESCRIPTION as a fieldname or controlname, it is a
reserved word

Problem names and reserved words in Access, by Allen Browne
http://www.allenbrowne.com/AppIssueBadWord.html

~~~

you can use an update query like this:

UPDATE Products
SET Descr = Trim("text to add " & [Descr])
be sure to put a space after the text to add
the Trim function will remove leading and trailing spaces

I changed your Description fieldname to Descr so a reserved word is not
being used <smile>

.... but, there is no need to store this information. Rather, you can
define a calculated field on a form or report like this:

=IIF(IsNull([ReleaseDate]), Null, "Product is not released yet and it is
expected on " & [ReleaseDate])

you could also make this calculation a concaentaion of what is already
in the Description -- but a calculated control cannot be edited -- that
is why I suggested a different control to hold this information

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
R

Robbie

The field name is actually annotation, I just typed description

Anyhow, I'm not using any forms to view this information. I have to prepare
the file before I import it into our website. So I run any queries or
"fixes" and then upload it to the web server and run the import application.

I didn't understand your second code suggestion because the releaes dates
are never null. I like your idea of putting the date in the annotation. I
currently have it displayed on another part of the page but nobody ever
looks there.

I tried to do something like this but it says invalid syntax. Your first
update query recommendation worked fine but I would like to add the date as
well.

Trim("This product has <b>not</b> been <b>released yet</b>. It is expected
to release around"& [ReleaseDate]". Please call for more information<br>" &
[Annotation])

strive4peace said:
Hi Robbie,
you can use an update query like this:

UPDATE Products
SET Descr = Trim("text to add " & [Descr])
be sure to put a space after the text to add
the Trim function will remove leading and trailing spaces

I changed your Description fieldname to Descr so a reserved word is not
being used <smile>

... but, there is no need to store this information. Rather, you can
define a calculated field on a form or report like this:

=IIF(IsNull([ReleaseDate]), Null, "Product is not released yet and it is
expected on " & [ReleaseDate])
 
S

strive4peace

Hi Robbie,

you need to join each phrase with & ... also, don't forget your spaces
-- and you must use a space on both sides of &

"...around"& [ReleaseDate]". Please..."
-->
"...around " & [ReleaseDate] & ". Please..."


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*



The field name is actually annotation, I just typed description

Anyhow, I'm not using any forms to view this information. I have to
prepare the file before I import it into our website. So I run any
queries or "fixes" and then upload it to the web server and run the
import application.

I didn't understand your second code suggestion because the releaes
dates are never null. I like your idea of putting the date in the
annotation. I currently have it displayed on another part of the page
but nobody ever looks there.

I tried to do something like this but it says invalid syntax. Your first
update query recommendation worked fine but I would like to add the date
as well.

Trim("This product has <b>not</b> been <b>released yet</b>. It is
expected to release around"& [ReleaseDate]". Please call for more
information<br>" & [Annotation])

strive4peace said:
Hi Robbie,
you can use an update query like this:

UPDATE Products
SET Descr = Trim("text to add " & [Descr])
be sure to put a space after the text to add
the Trim function will remove leading and trailing spaces

I changed your Description fieldname to Descr so a reserved word is
not being used <smile>

... but, there is no need to store this information. Rather, you can
define a calculated field on a form or report like this:

=IIF(IsNull([ReleaseDate]), Null, "Product is not released yet and it
is expected on " & [ReleaseDate])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Append Query 1
Append or Update Query? 1
Append Copy of Table 9
query to append and update? 4
Append / Update Date ? 1
Append Queries in 2007 5
INSERT to excel file 4
append query not appending 2

Top