This is a command button meant to take me to the next record that has the same value as ComboBox17. TextBox1 is just an index with all unique values that is located on the far right column of my table that I use to keep tabs on which record I am on. I had it working for a minute, but it must not have saved my changes and I can’t get it right again. The first time I press the button, everything appears to work properly, but then the second time the d value (record number) does not change.
Do you see why that might be?
Private Sub cmbNext_Click()
With ws.Range("WIGData")
Set d = .Find(TextBox1.Value, LookIn:=xlValues)
Set c = .Find(ComboBox17.Value, d, xlValues)
FirstAddress = d.Address
Set c = .FindNext(c)
Set d = c.Offset(0, 18)
MsgBox d
End With
With Me
.ComboBox15.Value = d.Offset(0, -20).Value
.ComboBox16.Value = d.Offset(0, -19).Value
….
.ComboBox18.Value = d.Offset(0, -1).Value
.TextBox1.Value = d.Offset(0, 0).Value
End With
End Sub
Bookmarks