PC Review Forums Newsgroups Microsoft Access Microsoft Access VBA Modules Composite Key and Input

Reply

Composite Key and Input

 
Thread Tools Rate Thread
Old 02-08-2007, 07:11 PM   #1
JohS
Guest
 
Posts: n/a
Default Composite Key and Input


Hi

I'm using a Composite Key of 3 indexes and am using 3 ComboBoxes to input.
But as I'm putting in new data into the fields I would come to the last
ComboBox and then I would have the message of that this record exist from
before (I'll have this message: "The changes you requested to the table were
not successful because they would create duplicate values in the index,
primary key, or relationship."). How could I prevent this from happing? Do I
need a VBA function to test if all these 3 input ComboBox data already
exist, and then just let them be populated, or if not add into a new record?
(Or is it any adjustment (some kind of form function) I could do inside
Access's own properties). Thanks, JohS


  Reply With Quote
Old 02-08-2007, 11:31 PM   #2
pietlinden@hotmail.com
Guest
 
Posts: n/a
Default Re: Composite Key and Input

On Aug 2, 12:11 pm, "JohS" <solimpn...@webmail.no> wrote:
> Hi
>
> I'm using a Composite Key of 3 indexes and am using 3 ComboBoxes to input.
> But as I'm putting in new data into the fields I would come to the last
> ComboBox and then I would have the message of that this record exist from
> before (I'll have this message: "The changes you requested to the table were
> not successful because they would create duplicate values in the index,
> primary key, or relationship."). How could I prevent this from happing? Do I
> need a VBA function to test if all these 3 input ComboBox data already
> exist, and then just let them be populated, or if not add into a new record?
> (Or is it any adjustment (some kind of form function) I could do inside
> Access's own properties). Thanks, JohS


One thing you could do is use the find Unmatched query wizard to
figure out which values have not been used... then you can only choose
these values. The rest would be eliminated from the combobox.

  Reply With Quote
Old 04-08-2007, 10:28 AM   #3
JohS
Guest
 
Posts: n/a
Default Re: Composite Key and Input

Thanks
<pietlinden@hotmail.com> wrote in message
news:1186090273.548490.57130@d30g2000prg.googlegroups.com...
> On Aug 2, 12:11 pm, "JohS" <solimpn...@webmail.no> wrote:
>> Hi
>>
>> I'm using a Composite Key of 3 indexes and am using 3 ComboBoxes to
>> input.
>> But as I'm putting in new data into the fields I would come to the last
>> ComboBox and then I would have the message of that this record exist from
>> before (I'll have this message: "The changes you requested to the table
>> were
>> not successful because they would create duplicate values in the index,
>> primary key, or relationship."). How could I prevent this from happing?
>> Do I
>> need a VBA function to test if all these 3 input ComboBox data already
>> exist, and then just let them be populated, or if not add into a new
>> record?
>> (Or is it any adjustment (some kind of form function) I could do inside
>> Access's own properties). Thanks, JohS

>
> One thing you could do is use the find Unmatched query wizard to
> figure out which values have not been used... then you can only choose
> these values. The rest would be eliminated from the combobox.
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off