Results 1 to 5 of 5
  1. #1
    onlylonely is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    110

    Listbox programming

    Hi Sir / madam,

    I've encounter some issue. Hopefully you can teach me on how to resolve the issue.
    In my listbox, there are 5 column.
    If in the listbox "Status" column showing "Pending RCA" then open form A..
    If in the listbox "Sattus" column showing "Pending Implementation" then open form B.

    Any idea what is the coding?



    Code:
    Private Sub List2_DblClick(Cancel As Integer)
    
    If List2.Column(5) = "Pending Implementation" Then   <<< Something not correct here..but i donno what it is.
    
    
    DoCmd.OpenForm "F2CAPAForm"
    
    
    Forms!F2CAPAform!txtscar = Me.List2.Column(1)
    
    
    Forms!F2CAPAform!txtscar.Enabled = False
    
    
    Else
    
    
    MsgBox ("wrong column")
    
    
    End If

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Reference columns by index. Index begins with zero so column 5 is index 4.

    List2.Column(4)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    onlylonely is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    110
    Quote Originally Posted by June7 View Post
    Reference columns by index. Index begins with zero so column 5 is index 4.

    List2.Column(4)
    I've tried List2.Column(3) ,4,5,6 still not able to get.
    Code:
    Private Sub List2_DblClick(Cancel As Integer)
    
    
    If List2.Column(5) = "Pending Implementation" Then
    
    
    DoCmd.OpenForm "F2CAPAForm"
    
    Forms!F2CAPAform!txtscar = Me.List2.Column(1)
    
    
    Forms!F2CAPAform!txtscar.Enabled = False
    
    
    Else
    
    
    MsgBox ("wrong column")
    
    
    End If
    Click image for larger version. 

Name:	listbox.JPG 
Views:	11 
Size:	53.0 KB 
ID:	41024

    Any idea?

    Thank You,
    Regards,
    tonyshieh

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Why does a space show in front of " Pending RCA"?

    Exactly what is the issue - error message, wrong result, nothing happens?

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    onlylonely is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    110
    Hi June,

    Because of the space, it wasted my time. Stupid me.
    Thanks for teaching

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

Similar Threads

  1. Replies: 4
    Last Post: 05-29-2015, 09:36 AM
  2. Replies: 1
    Last Post: 01-31-2015, 09:03 PM
  3. Replies: 2
    Last Post: 03-23-2014, 06:50 AM
  4. Replies: 1
    Last Post: 09-10-2012, 11:21 PM
  5. Replies: 1
    Last Post: 07-26-2012, 11:45 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