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 Shaun E 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 auto-increment my foreign keys

Status
Not open for further replies.

learnasugo

Programmer
May 10, 2004
38
US
I am having problems with my database because my foreign keys are empty. Is there a way to make them auto-increment just like an autonumber?

Thanks

learnasugo

 
Hi learnasugo,

Can you post some information on what you're trying to do because the idea of auto-incrementing foreign keys suggests, at the very least, a problem with your database design.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
I did a print screen of the relationship window, but have no idea how to paste it into this forum. Can you help me?

Thanks for your help
learnasugo
[sad]

 
Hi learnasugo,

You can't upload anything directly here. You need to have some webspace somewhere else and then reference it from here with an IMG tag (click on the Process TGML link just below the input box where you type your post for full details).

If there's not too much of it, you could post the (relevant) text from the documentor instead.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
This applies to alot of my tables because of the crazy stuff that my boss wants. Anyway I'll try.

Presort tbl (Many Side)
PresortID (PK-Autonumber)
FormatID (FK-Long Integer)

Format tbl (One Side)
FormatID (PK-Autonumber)

Does that help? Let me know if you need more info.

I have almost gotten rid of these errors because of the order in which I have the people fill out the information, but just in case.......

Thanks,
learnasugo
 
Hi learnasugo,

And under what circumstances do you want what, exactly, to happen?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
The person will be entering the information into the presort table. There is a field in the format table that is being pulled into the form. I don't know if I was just having problems in the early stages of testing because I was testing one form at a time and now I actually have a few records in the tables (aside from the 3 records that I have just recently put in all of the tables are empty). I'm hoping that that was the problem, although that does lead to another problem since I am using autonumbers for PK for all of my tables. How can I set the autonumber back to zero?

Thanks

learnasugo
 
Hi learnasugo,

You really shouldn't care what value an autonumber has. If the value is important, you shouldn't use an autonumber. That said, you can set an autonumber back to zero by emptying the table and compacting the database.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top