Assigning Primary Key Value

nestoc

Registered User.
Local time
Today, 11:09
Joined
Mar 31, 2013
Messages
11
Hello All. First time poster - I hope I am posting this in the right forum.

I have an access form which includes my primary key field "ID". Normally when I use this form to enter a new record this field displays "(New)" until I enter data in any other field, then the ID field updates to reflect the new value. This worked fine when the table I was adding the record to was a table linked from another access database.

I recently moved my data to SQL Server 2008, without making any other changes to the application, and this behavior has changed. Now when I enter data into a new record the ID field changes to "NULL". And I am not able to reference this value in my program (Me.ID) like I used to be able to. When I save the record the ID field gets assigned and everything works as normal.

So I am able to make my application work again by forcing the record to save before trying to reference Me.ID, but I was wondering if someone could explain to me what is going on here and why the behavior changed when my table moved from Access to SQL Server.
 

Users who are viewing this thread

Back
Top Bottom