
Access counter field value during AddNew
Quote:
Biow) writes:
>>Is there any way to get the value of a new record's counter field during
>>the validate event?
>Yes, you need to "tickle" the new record after doing your AddNew.
>dta.Recordset!SomeField = Something will cause the counter field
>to be issued. You can then read it.
Actually, I've found something kind of interesting since posting the
original message. When I made my first attempts, I was using an Access 1.1
MDB and I had not installed the compatibility layer. No matter what I did,
I could not get the new counter field value to show up either in a bound
control or in the data control's recordset.
Then I began working on another project that used an Access 2.0 database,
so I had to install the compatibility layer. When I returned to the first
project, it behaved just as I had been expecting it to all along: as soon
as the AddNew is executed, the new counter field value shows up in the
bound control and in the recordset.
Either I was imagining things when I first tried this or else the
compatibility layer has actually done something to change the behavior in
this area.
Steve Diamond
Diamond Consulting Services