I had to set RecordsetType = 1. It seems there's some problem in A2002
because with RecordsetType = 0 there was one more problem: I couldn't easily
change date field (dbDate) in new record in edit mode (F2). When I tried to
edit date (CZ format) in edit mode MS Access deleted the date string, eg.
1) DefaultValue = Date() ... 28.3.2007
2) in new record I clicked on the digit 8 and pressed Delete (I wanted to
change 28 to 29)
3) the result: blank field after I pressed Delete
After some tests (when no event procedures were active) I discovered that
all works OK if I set RecordsetType to 1. BTW, with RecordsetType = 0 (in
query) MS Access doesn't display default values which are set in DB table
design. And, weird, sometimes it displays default values and sometimes it
does NOT display default values when I run the query.
The SQL is one of the simplest:
SELECT FO.*, BaVypis.ID_Cis2ss06
FROM FO INNER JOIN BaVypis ON FO.ID_BaVypis = BaVypis.ID_BaVypis;
Now it seems that with frm.RecordsetType = 1 all goes OK. To perform some
tests in query I had to set frm.RecordsetType to 1 as well. I think I will
have to make some research on this behaviour... :-/
Vlado
"Dirk Goldgar" <(E-Mail Removed)> píše v diskusním příspěvku
news:(E-Mail Removed)...
> In news:(E-Mail Removed),
> Vladimír Cvajniga <(E-Mail Removed)> wrote:
>> When I edit a table with a unique primary key, that is composed of
>> more than one field, and enter duplicate values (ie. duplicate key) I
>> can't leave the record (which is OK) but Access 2002 doesn't tell me
>> that I entered duplicate key (which is NOT OK). Is that just a
>> mis-feature of A2002?
>> In A97 there's a message box telling user that a duplicate key was
>> entered. Is there any workaround for A2002, eg. global DB settings?
>
> I just made a test case and got an error message about the duplicate key.
> I made a table with a compound primary key, opened it in datasheet view,
> entered a record with one pair of key values, then tried to enter another
> record with the same key values. I got the standard duplicate-key
> message: "The changes you requested to the table were not successful
> because they would create duplicate values in the index, primary key, or
> relationship."
>
> Are you sure you aren't trapping this error somehow, and ignoring it? Did
> you try this in a table datasheet, or in a form?
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>