J
Junior
Using the following code to add a record to tblApp - it works -
but the recordsetclone section returns the form to the first record in
tblApp and not the one just saved?
what am i doing wrong?
Dim db As Database
Dim rsApp As DAO.Recordset
Set db = CurrentDb
Set rsApp = db.OpenRecordset("tblApp", DB_OPEN_DYNASET)
rsApp.FindFirst "SSN = " & Chr(34) & strApSSN & Chr(34)
If rsApp.NoMatch Then
rsApp.AddNew
rsApp("SSN") = (strApSSN) 'strApSSN public variable last SSN entered
into TblMstr
rsApp("AppPosition") = "xxx"
rsApp("ApplicationDate") = VBA.Date
rsApp.Update
rsApp.Close ' Close table.
Set rsApp = Nothing
RunCommand acCmdSaveRecord
Me.txtSSN.Requery
If Not IsNull(Me!txtSSN) And Me.txtSSN <> 9999999 Then
Me.RecordsetClone.FindFirst "[AppID] =" & Me![txtSSN]
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
End If
but the recordsetclone section returns the form to the first record in
tblApp and not the one just saved?
what am i doing wrong?
Dim db As Database
Dim rsApp As DAO.Recordset
Set db = CurrentDb
Set rsApp = db.OpenRecordset("tblApp", DB_OPEN_DYNASET)
rsApp.FindFirst "SSN = " & Chr(34) & strApSSN & Chr(34)
If rsApp.NoMatch Then
rsApp.AddNew
rsApp("SSN") = (strApSSN) 'strApSSN public variable last SSN entered
into TblMstr
rsApp("AppPosition") = "xxx"
rsApp("ApplicationDate") = VBA.Date
rsApp.Update
rsApp.Close ' Close table.
Set rsApp = Nothing
RunCommand acCmdSaveRecord
Me.txtSSN.Requery
If Not IsNull(Me!txtSSN) And Me.txtSSN <> 9999999 Then
Me.RecordsetClone.FindFirst "[AppID] =" & Me![txtSSN]
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
End If