1. i suggest you add another field on your tblHld, aside from having uniqueID field add a field called FormName (short text).
2. On top of your form module declaration (just below Option Compare Database or Option Explicit), declare a private variable to hold your UniqueID
Private lngUniqueID as Long
3. OnCurrent event of your form (frmDays):
Private Sub Form_Current()
lngUniqueID = Me.UniqueID
End Sub
4. On your form On Load event:
Private Sub Form_Load()
Dim lngRecordID As Long
lngRecordID = Nz(DLookup("UniqueID", "tblHld", "[FormName] = '" & Me.Name & "'"), 0)
If lngRecordID > 0 Then
DoCmd.GoToRecord acActiveDataObject, Me.Name, acGoTo, lngRecordID
End If
End Sub
5. On your form's Unload event:
Private Sub Form_Unload(Cancel As Integer)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Select * from tblHld Where [FormName] = '" & Me.Name & "';")
With rs
If .RecordCount > 0 Then
.Edit
Else
.AddNew
![FormName] = Me.Name
End If
![UniqueID] = lngUniqueID
.Update
End With
Set rs = Nothing
Set db = Nothing
End Sub