Hi,
I need to enter a project name in the textbox (Name: txtProjectName) and the entered project name will be automatically stored in the combo box (Named: ProjectNames). No problem in the above steps. The problem is here, it need to show the error if I enter the project name which is previously exist. The below code doesn't work for me
Private Sub cmdOK_Click()
For i = 0 To ProjectNames.ListCount - 1
If ProjectNames.List(i).value = txtProjectName.Value Then
MsgBox "This Project is already exists!", vbInformation
Exit For
End If
Next I
End Sub
It shows error for each project I enter in the textbox even though the project name doesn't exist already.
Please help.
Bookmarks