copy a value from one record into other records.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following rows and columns in a table
C1 C2
1
A
B
2
A
B
C
etc.

I want to duplicate the value in column 1 into the following records.

1
1 A
1 B
2
2 A
2 B
2 C
etc.

I can do this in Excel. Is there a way to do it in Access?

-Al
 
Nearly impossible or at least un-reliable without a field that describes the
exact sequence of the records. You have a couple records with only A in C2.
Access tables doesn't necessarily know the difference between the two
records. The same is true for the two records with B.

Do you have a primary key in the table that you aren't telling us about? If
you don't have one, can you create one?
 
Assuming you add a sequence field named ID, you could create an update query
like:

UPDATE tblNoName SET tblNoName.C1 =
DMax("tblNoName.[C1]","tblNoName","[ID]<=" & [ID]);
 
Thank you very much. I shall have to study this.

Al


Duane Hookom said:
Assuming you add a sequence field named ID, you could create an update query
like:

UPDATE tblNoName SET tblNoName.C1 =
DMax("tblNoName.[C1]","tblNoName","[ID]<=" & [ID]);

--
Duane Hookom
Microsoft Access MVP


AlKolwicz said:
Yes, I can add a primary key. the records are sequential.

Al
 
Back
Top