Hi

I need some help regarding a problem with Access XP and Access 2007/2003,
The problem is in VB code, the code is working fine in Access XP but not in Access 2007/2003:
Access is connected to an MSSQL 2005 server and the problem is on auto generated Field “ID”

Private Sub Kommandoknap94_Click()
On Error GoTo Err_Kommandoknap94_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
Dim rs As New ADODB.Recordset
rs.Open "tblNyNr", CurrentProject.Connection, adOpenKeyset, adLockOptimistic


rs.AddNew
rs("fldDato").Value = Now
Me![fldNyNR] = rs("id")
rs.Update
rs.Close
Me!Dato = Now()
DoCmd.PrintOut acSelection
Me!SidstKørt = Now()

Exit_Kommandoknap94_Click:
Exit Sub

Err_Kommandoknap94_Click:
MsgBox Err.Description
Resume Exit_Kommandoknap94_Click

End Sub

The part that is not working is
Me![fldNyNR] = rs("id")
The code returns zero? But the new record is added to the table.

Please help
Thanks.