Connecting Tech Pros Worldwide Forums | Help | Site Map

Set 2 fiels to same value

mickyp's Avatar
Newbie
 
Join Date: Sep 2006
Posts: 1
#1: Sep 4 '06
Hi There,

I have an access database where I would like to set two fields to the same value.
Both fields are in the same table called Sampletbl

The one field is called Year and the other Years.

Is there anyway to get access to populate field year with the same value as field years automatically.

Thankx
MickyP

PEB's Avatar
PEB PEB is offline
Expert
 
Join Date: Aug 2006
Location: Bulgaria
Posts: 1,380
#2: Sep 4 '06

re: Set 2 fiels to same value


Hi,

The way to do it is to use an Update Query!

You have to do a new query and in SQL view you type the folling SQL:

UPDATE [Sampletbl] SET [Sampletbl].Year = [Years];

And than you press the run sql buton and you run the query!

Will appear a message that your records will be updated!
msquared's Avatar
Administrator
 
Join Date: Aug 2006
Location: Dublin, Ireland
Posts: 10,886
#3: Sep 5 '06

re: Set 2 fiels to same value


You don't say where you would like this update to happen. For example, is it during a user entering data on a form, etc.



Quote:

Originally Posted by mickyp

Hi There,

I have an access database where I would like to set two fields to the same value.
Both fields are in the same table called Sampletbl

The one field is called Year and the other Years.

Is there anyway to get access to populate field year with the same value as field years automatically.

Thankx
MickyP

Reply


Similar Microsoft Access / VBA bytes