Results 1 to 2 of 2
  1. #1
    empyrean is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    5

    Checking List Box Value with Combo box selection

    Hi

    I have a combo box with some values, when i select the data in the box it should check with the data present in the list box if it did not find its duplicate then the list box should take this value and if it finds the value if should pop up a msg box saying duplicate value found.



    Can anyone help me in this?

  2. #2
    empyrean is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    5
    I tried this but still not working


    Private Sub CommandResult_Click()
    Dim varItm As Variant
    Dim duplicate As Boolean

    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
    ' ListAliasInformation.AddItem ComboCheck.Value

    If Not duplicate Then
    Me.ListAliasInformation.AddItem (Me.ComboCheck.Value & ";" & Me.ListAlias.Value)
    End If
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 10-19-2009, 02:37 AM
  2. Replies: 1
    Last Post: 08-26-2009, 10:45 AM
  3. Replies: 3
    Last Post: 02-26-2009, 10:17 AM
  4. Problems with list or combo box on tabbed form
    By kydbmaster in forum Forms
    Replies: 0
    Last Post: 02-20-2008, 01:33 AM
  5. Replies: 1
    Last Post: 03-09-2006, 12:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums