n my code when i use itemdata (int Y) its checking my second column where my alias information is there but i wanted it to check with first column. If i change the way it adds to columns i.e entering alias in first column. it checks and give me duplicate message but i dont want to exchange the columns.
This is a form in access 2003 and VBA is used for this
Code:
Private Sub CommandResult_Click()
Dim intY As Long
'~~> Loop through List
For intY = 0 To ListAliasInformation.ListCount - 1
'~~> Check if Combo Value exists in list
If ListAliasInformation.ItemData(intY) = ComboCheck.Value Then
'~~> If found, Inform User
MsgBox ComboCheck.Value & " Already Exits in list"
'duplicate = True
Exit Sub
End If
Next intY
'~~> Add Item to List
Me.ListAliasInformation.AddItem (Me.ComboCheck.Value & ";" & Me.ListAlias.Value )
End Sub