Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Visual Basic for Applications

Post new topic   Reply to topic
Primary Key question
View previous topic :: View next topic  
Author Message
SKP
Newbie


Joined: 23 Dec 2003
Posts: 7

PostPosted: Jan 14th, 2004 11:25 AM    Post subject: Primary Key question Reply with quote

I'm having problems with a primary key value. The situation is that I have a combo box in a subform that I want to be able to add a contact and the related info in the record if the contact is not already listed in the combo box.

I have a command button to call a form to enter all of the information for the new contact record. I have one field set up to automatically fill in the firm name based on the main form.

The problem is the firm name that I have filling in is the primary key for one table, but not in my contacts table. When I enter the information, I get an error saying that I am getting duplicates of the primary key. I have no other relationships set up between the contact list and firm name list so I don't know why this is happening! I also checked the contact table to make sure that I could have duplicates in that field.

If anyone has any idea why I'm getting a duplicate error, I could really use some insight. Thanks in advance!
Back to top
View user's profile Send private message
Andir
Centurion


Joined: 21 Dec 2003
Posts: 184
Location: Chicago Area

PostPosted: Jan 20th, 2004 04:01 AM    Post subject: Reply with quote

It sounds almost like a Database issue, but I'm not positive. Does the database have an "Auto-Number"ing key? do you have a control on the form that stores a previous index/key? It may be trying to re-insert this stored key to the new record.
_________________
If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Visual Basic for Applications All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic