Trying to save a new record but failing

Jon123

Registered User.
Local time
Today, 18:23
Joined
Aug 29, 2003
Messages
668
I have read a few posts but very new to sql and could use some help.

I have a save button on a form that runs this code

DoCmd.GoToRecord , , acNewRec

But it does not work. It worked in access but not is sql any ideas ?

please help
 
Make sure the table in SQL Server has a primary key defined.
 
Yes the table has a PK
 
Okay, so can you update the table manually? Will changes be there? If so, then maybe try this in the form BEFORE trying to move to another record:

Code:
If Me.Dirty Then Me.Dirty = False
 
I set the PK idenity field to YES and now its working. Could you tell me why that fixed it?
 
I set the PK idenity field to YES and now its working. Could you tell me why that fixed it?

My guess is that your original Access table had an autonumber PK and SQL Server's autonumber is IDENTITY.
 

Users who are viewing this thread

Back
Top Bottom