I have some code on a form which generates a new record. However after adding one or two records there seems to be differences between the Primary key number of the bound table (seen on a bound text box) to what I get on my PK1 value.
Although there are differences, when I use a list box to find a record, or look in the table, there seems to be no problems. It's just a bit alarming seeing differences. I have tried Me.Requery statements but it remains the same.?
Although there are differences, when I use a list box to find a record, or look in the table, there seems to be no problems. It's just a bit alarming seeing differences. I have tried Me.Requery statements but it remains the same.?
Code:
Dim rst As Recordset
Dim db As DAO.Database
Set db = CurrentDb()
Dim rst As Recordset
Set rs1 = db.OpenRecordset("MAIN", dbOpenDynaset)
rs1.AddNew
rs1!IncidentNumber = Me.INCN
PK1 = rs1!ID1
rs1.Update
Me.PK=PK1
Set rst = Me.RecordsetClone
rst.FindFirst "ID1 =" & PK1
If rst.NoMatch = False Then
Me.Bookmark = rst.Bookmark
Else
MsgBox "not found"
End If