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

    List box column check..


    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

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try:
    If ListAliasInformation.ItemData( 0 , intY ) = ComboCheck.Value Then

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

Similar Threads

  1. Check Box Value
    By mulefeathers in forum Programming
    Replies: 4
    Last Post: 10-09-2009, 08:31 PM
  2. List box to populate other list boxes
    By Nathan in forum Forms
    Replies: 0
    Last Post: 03-03-2009, 07:22 PM
  3. Check Box issues
    By data123 in forum Forms
    Replies: 0
    Last Post: 01-03-2007, 03:21 PM
  4. check boxes
    By chiefmsb in forum Forms
    Replies: 1
    Last Post: 11-14-2006, 02:22 PM
  5. inserting values in column based another column
    By wasim_sono in forum Database Design
    Replies: 1
    Last Post: 06-27-2006, 05:23 AM

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