Flippertje
Technical User
It's absolutely staring me in the face... but i'm clueless (perhaps not a good day to be coding??)
I receive forms with a number, emailadress and an amount. I enter this data in a table 'Tab_Forms' (fields: Indexnr, Emailadress, Amount). The field Indexnr is indexed and no duplicates are allowed to prevent the same form from being entered twice.
I have build a form that has this table as recordset. On Form_Load i use Me.Recordset.Addnew so that it opens blank.
On the form a have a listbox that lists all the forms in the table. On doubleclick on a record in the listbox, i've coded
me.recordset.findfirst "[Indexnr]=" & me.listbox1.value
This places the record in the form. At that point i can start filling fields in the subform tha's also in the form.
After filling the subform i have a button called 'Engage' (Startrekfan). That has a code
me.indexnr.setfocus
me.requery
me.recordset.addnew
me.listbox1.requery
When i click this button i get an error with number 3022 (translated from ducth: The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship.) The code stopped at Me.Requery
Anyone around that can help me out this (i'm pretty sure) simple problem?
Many tHanks!!!
I receive forms with a number, emailadress and an amount. I enter this data in a table 'Tab_Forms' (fields: Indexnr, Emailadress, Amount). The field Indexnr is indexed and no duplicates are allowed to prevent the same form from being entered twice.
I have build a form that has this table as recordset. On Form_Load i use Me.Recordset.Addnew so that it opens blank.
On the form a have a listbox that lists all the forms in the table. On doubleclick on a record in the listbox, i've coded
me.recordset.findfirst "[Indexnr]=" & me.listbox1.value
This places the record in the form. At that point i can start filling fields in the subform tha's also in the form.
After filling the subform i have a button called 'Engage' (Startrekfan). That has a code
me.indexnr.setfocus
me.requery
me.recordset.addnew
me.listbox1.requery
When i click this button i get an error with number 3022 (translated from ducth: The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship.) The code stopped at Me.Requery
Anyone around that can help me out this (i'm pretty sure) simple problem?
Many tHanks!!!