Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to create a duplicate value in another field 1

Status
Not open for further replies.

ElBlues

Programmer
Jul 1, 2004
13
0
0
GB
I have a table with an autonumber primary key. What I want to do is automatically duplicate the value created in this field, in two other fields.

Can I create an expression to do this?
 
Sorry to be so blunt but there is no reason in the world for a table to have 3 fields which always contain the same values.

What is your aim in doing this?
 
Its a little long winded...
Its based around a football league website premise...

I have a Teams table and a Fixtures table.
The Teams table has Team_ID column for each team, the fixtures table has a Hometeam_ID column and an Awayteam_ID column.
The problem I have is relating the Hometeam_ID and Awayteam_ID columns to the single Team_ID column!!

Access wont let me create a relationship between Team_ID and both Home/Awayteam_ID due to the name.
So I thought that if I create two new columns in the Teams table (Hometeam_ID, Awayteam_ID) and give them the same values as Team_ID it wouild solve the relationship problem!
 
I'm not sure if this will meet all your objectives but try this.

In the Relationships window add the teams table to the window twice. You can then link the fixtures table to each copy of the Teams table using different fields.
 
That seems to have done the trick...
Only now I can only retrieve either the hometeam name or the away team name (as when joined, both have the field name Teamname).

Thanks anyway, will post this new problem in the sql section!
 
There is a reason why you would need to have the Autonumber field duplicated. I am using a form that upon a button click it transfers the recordsource to another table with identical layout. As the form i've created is extensive it would be a pain to have all of my code change depending on what record source i'm in. I would like the autonum field to be duplicated so that i can have a InProductID field and an OutProductID field so i can create apropriate relationships for. Also I know i can do this with some code but i dont want code to run everytime a record is inserted, plus with multi users it would create a mess. Does anyone have an idea?
 
There still should be no need to have the same value in the table twice.

What exactly are you planning to do with the 2nd field when you transfer the record?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top