VERSION 1.0 CLASS BEGIN MultiUse = -1 'True END Attribute VB_Name = "DataUSFManager" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = False Attribute VB_Exposed = False Option Explicit Public Map Private mIndex As Long Private mTable As ListObject Private mUsf As UserForm Property Get Index() As Long Index = mIndex End Property Property Let Table(Value As ListObject) Set mTable = Value End Property Property Let Usf(Value As UserForm) Set mUsf = Value End Property Function GoToPrevious() As Long If mIndex > 1 Then mIndex = mIndex - 1 updateUserform Else GoToPrevious = 1 End If End Function Function GoToNext() As Long If mIndex < mTable.ListRows.Count Then mIndex = mIndex + 1 updateUserform Else GoToNext = 1 End If End Function Function GotoRecord(Index As Long) As Long If mTable.ListRows.Count >= Index And mTable.ListRows.Count > 0 And Index >= 1 Then mIndex = Index updateUserform Else GotoRecord = 1 End If End Function Sub GotoNew() mIndex = 0 End Sub Function Delete() As Long mTable.ListRows(mIndex).Delete If mTable.ListRows.Count > 0 Then If mIndex > mTable.ListRows.Count Then mIndex = mTable.ListRows.Count updateUserform Else Delete = 1 End If End Function Sub updateUserform() Dim r As ListRow Dim Counter As Long Dim ControlName As String Dim ColumnName As String Set r = mTable.ListRows(mIndex) For Counter = 1 To UBound(Map, 2) mUsf.Controls(Map(1, Counter)).Value = r.Range(mTable.ListColumns(Map(2, Counter)).Index).Value Next End Sub Sub UpdateTable() Dim r As ListRow Dim Counter As Long Dim ControlName As String Dim ColumnName As String If mIndex = 0 Then mTable.ListRows.Add mIndex = mTable.ListRows.Count End If Set r = mTable.ListRows(mIndex) For Counter = 1 To UBound(Map, 2) r.Range(mTable.ListColumns(Map(2, Counter)).Index).Value = mUsf.Controls(Map(1, Counter)).Value Next End Sub