Question about acCmdSaveRecord

EFox

Registered User.
Local time
Today, 14:35
Joined
Jun 12, 2014
Messages
23
Hello,

I inherited an access application front end and back end and I changed to a SQL server back end.

There are fields that seemed to auto increment from a previous record number (no not primary key that is set to autonumber). These fields are never given a specific value, but from previous transactions it looks like they automatically increment. Prior to the change to SQL all of these values would change, and now they are set to NULL using the same logic. I have been talking with the person that created this application (he knows access about as well as I do) and he can't explain to me how these values are doing what they are doing.

Code wise there is nothing written that manually increments these numbers or a query called to increment them. I was trying to get a clear understanding of what the acCmdSaveRecord does, and if that actually does the increment for me, or if by creating a new record the number updates for me? I thought it would just save whatever data was on the form to the specific table and not do increment type tasks.

I appreciate any answers or help/suggestions. I am going to keep digging into this until I can find out why these numbers are no longer doing what they were doing properly before the SQL switch.

Thanks,
Eric
 
I'm guessing it is still some kind of autnumber issue. Seems best if you figure out what's going on in the old version before you try to make sense of the new version. That is if you need the field, if not just leave it alone or delete it...
 
Sounds like there's a DMax() on the Before_Update or Before_Insert of the Form. (However, if the field is NULL then something is *broken* somewhere.) In any event the acCmdSaveRecord forces the Save once it inserts the ID so the number doesn't *clash* with another Users record if both of you are trying to Save at the same time. So, it ensure you each get a unique and seperate number/ID.
 

Users who are viewing this thread

Back
Top Bottom