ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,732
- Office Version
- 2007
- Platform
- Windows
Hi,
On my userform i have ComboBoxes that didnt have anything in the drop down list so i changed them for just standard TextBoxes.
I still used the same name just TextBox as opposed ComboBox
When i now try to open the form i see this error message Could Not Find The Specified Object.
Below is the code it debugs to & the line in question shown in yellow.
On my userform i have ComboBoxes that didnt have anything in the drop down list so i changed them for just standard TextBoxes.
I still used the same name just TextBox as opposed ComboBox
When i now try to open the form i see this error message Could Not Find The Specified Object.
Below is the code it debugs to & the line in question shown in yellow.
Rich (BB code):
Sub Navigate(ByVal Direction As XlSearchDirection)
Dim i As Integer
Dim LastRow As Long
LastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
R = IIf(Direction = xlPrevious, R - 1, R + xlNext)
'ensure value of r stays within data range
If R < startRow Then R = startRow
If R > LastRow Then R = LastRow
'get record
For i = 1 To UBound(ControlNames)
Me.Controls(ControlNames(i)).Text = IIf(Direction = xlNone, "", ws.Cells(R, i).Text)
Next i
Me.Caption = "Database"
'set enabled status of next previous buttons
Me.NextRecord.Enabled = IIf(Direction = xlNone, False, R < LastRow)
Me.PrevRecord.Enabled = IIf(Direction = xlNone, False, R > startRow)
EventsEnable = False
Me.ComboBoxCustomersNames.ListIndex = IIf(Direction = xlNone, -1, R - startRow)
EventsEnable = True
End Sub