Access counter field value during AddNew 
Author Message
 Access counter field value during AddNew


Quote:

>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.


Tue, 20 May 1997 01:50:56 GMT  
 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



Tue, 20 May 1997 16:35:10 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Access counter field value during AddNew

2. Counter Fields - value assigned on Addnew not Update?

3. Checking field values in WillChangeRecord during AddNew

4. Getting the counter value after an addnew-SQL SERVER 2000/ADO

5. Help resetting counter field value?

6. How do I gett the value of autoincrement field after an .AddNew/.Update

7. How to get a field value after and AddNew command SQL 7.0 and VB 6

8. Null value in AUTONUMBER field after MyRS.RECSET.AddNew

9. Change field value during Make Table?

10. Getting the value of an autoincrement or identity field during an sql insert

11. Getting the value of an autoincrement or identity field during an sql insert

12. Counter field in Access 2000

 

 
Powered by phpBB® Forum Software