Can you make a field have the same value in all records?

  • Thread starter Thread starter Leisle
  • Start date Start date
L

Leisle

Hi all. I'm hoping someone can help me with this. I'm
working on a database for my husband and for one of the
queries I need a field on all the records of a certain
table to have the same text in them. Is this possible
and how would I do it if it is? I appreciate any help on
this. Thanks.

Leisle
 
I want to fill an existing field with a certain value for
all records in the table.

Leisle
 
Take a look at the Default Value property in table design. I sounds like you want to put the same value in every record - enter that value in the default value property on the general tab in the table design view.

However, I need to ask why you want to store the same value with every record - there is probably a better way to do what you need done.
 
OK,

Create a SELECT query as you would normally (making sure to include the
Primary Key(s)). Then take the following steps:

1. While in the Query Designer, select [Update Query] from the [Query] menu.

2. In the [Update To] row for the field you want to change, enter the value
you want to change it to.

3. Double-check, then triple-check that you have the right table, the right
field, the right value, etc...

4. When you're satisfied that you really want to CHANGE EVERY RECORD IN THE
TABLE, select [Run] from the [Query] menu.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 
Hi Leslie,

I hope you've made a backup of your database (just make copy of it and give
it a different name) before you start trying things you hear here. You
should always make a backup when you're about to break new ground.

If you want the value to be there by default but could have a meaningful
different value in some cases going with the Update Query to get where you
want to be followed by setting the Default value would solve your issue.

However, if every record in the database will always have that value, you're
violating one of the rules for relational databases, i.e. that every element
(field) of a record depend on the key for that record and nothing but the
key. If the given field in all records will always have the same value, it
contributes absolutely no information! No, the relational database cops
won't come and get you but it means that you don't fully understand how to
use the database. You could save space and a lot of database thrashing by
simply declaring a constant and displaying the value of the constant
anywhere you would have otherwise have displayed the field.

Again, if the query you are trying to get to fly is looking for information
that is guaranteed to be in every record then if that's the only criteria,
all records will be returned.

Is it possible that you really mean that your database has some records with
the certain value and that other records have other values? That would be
the normal case. If so, open your query in the Query wizard/QBE designer
and put the value you want to find in the criteria line for that field. If
this is your first go at designing a query, look in Access Help for Query.
Look also for Criteria.

HTH
--
-Larry-
--

Scott Shearer said:
Take a look at the Default Value property in table design. I sounds like
you want to put the same value in every record - enter that value in the
default value property on the general tab in the table design view.
However, I need to ask why you want to store the same value with every
record - there is probably a better way to do what you need done.
 
Thank you.
-----Original Message-----
OK,

Create a SELECT query as you would normally (making sure to include the
Primary Key(s)). Then take the following steps:

1. While in the Query Designer, select [Update Query] from the [Query] menu.

2. In the [Update To] row for the field you want to change, enter the value
you want to change it to.

3. Double-check, then triple-check that you have the right table, the right
field, the right value, etc...

4. When you're satisfied that you really want to CHANGE EVERY RECORD IN THE
TABLE, select [Run] from the [Query] menu.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd- 0764559036.html


I want to fill an existing field with a certain value for
all records in the table.

Leisle with a
certain value (for help
on


.
 
Back
Top