I have a ComboBox that populates values from a sheet. I am trying to select the first or second value in the combobox by default when the form initialize. Can anyone help me with how should I do this?
Sub Reset()
Dim iRow As Long
iRow = [Counta(Database!A:A)] ' idetifying the last row
With frmForm
.txtID.Value = ""
.txtVName.Value = ""
.optMale.Value = False
.optFemale.Value = False
'Default Color
.txtID.BackColor = vbWhite
.txtVName.BackColor = vbWhite
.txtTimeIn.BackColor = vbWhite
.txtPName.BackColor = vbWhite
.cmbNationality.BackColor = vbWhite
.cmbDept.BackColor = vbWhite
'--------------------------------
'Creating a dynamic name for Department
shDept.Range("A2", shDept.Range("A" & Application.Rows.Count).End(xlUp)).Name = "DynamicDept"
.cmbDept.RowSource = "DynamicDept"
.cmbDept.Value = ""
End With
End Sub