ListView Question

See attached.

this is wonderful! thanks a lot vbaInet.

i just modified a bit, because when i tried to resize the listview window until it shows only three items out of ten, the window didn't scroll though the item is highlighted, what i did is this:

Code:
Private Sub txtSearch_Change()
    If Len(Me.txtSearch.Text & vbNullString) <> 0 Then
        With rs
            .FindFirst "Forename LIKE '*" & Me.txtSearch.Text & "*'"
            If Not .NoMatch Then
                lvSrch.ListItems(.AbsolutePosition + 1).Selected = True
                [COLOR=blue]' ************* i add this line **************[/COLOR]
[COLOR=blue]               lvSrch.ListItems(.AbsolutePosition + 1).EnsureVisible[/COLOR]
[COLOR=blue]               '***************************************[/COLOR]
            End If
        End With
    End If
End Sub

and it works fine, again thanks a lot.
 
Sure master ;)

hi vbaInet, i don't know what i did, i just copy all the codes you provided to me, but it seems it doesn't work with my form. can you please enlightened me. i'm attaching the db. thanks
 

Attachments

hi vbaInet, i don't know what i did, i just copy all the codes you provided to me, but it seems it doesn't work with my form. can you please enlightened me. i'm attaching the db. thanks

don't worry boss, i found the problem, i uncheck the hide selection in the listview properties. and it's working fine.
 
I was just opening your db when you posted. Well, there you go, one of those properties you forgot to untick.

By the way, I don't think you need the API anymore because FullRowSelect should do it.
 
I was just opening your db when you posted. Well, there you go, one of those properties you forgot to untick.

By the way, I don't think you need the API anymore because FullRowSelect should do it.

it's so funny, because i finished two sticks of cig before i found what caused the problem. anyways going back to API where should I put the FullRowSelect?
 
You have it already in your code, i.e. the Open event. So comment out all the API stuff.
 
You have it already in your code, i.e. the Open event. So comment out all the API stuff.

yup i quote it, and it work the same.

whew! that's a nice piece of work.

thanks. :)
 
I'm running 2010 on my laptop and when I opened your db it worked fine.

1. Remove the error handling and put a message box to see if it's firing.
2. In the VBA editor, at the top right hand side where you select the function/sub, make sure the ItemClick is bold.
 
I'm running 2010 on my laptop and when I opened your db it worked fine.

1. Remove the error handling and put a message box to see if it's firing.
2. In the VBA editor, at the top right hand side where you select the function/sub, make sure the ItemClick is bold.

thanks vbainet, i did quote everything and put only a message box but still my itemclick doesn't firing up, and also sorry for miscom i'm using 2013 access version.
 
What about point number 2?

2. In the VBA editor, at the top right hand side where you select the function/sub, make sure the ItemClick is bold.

yes it was in bold. see image attached.
 

Attachments

  • scrcap.gif
    scrcap.gif
    20 KB · Views: 75
Strange! Are you working on a different machine than before?
And is it the same db you posted before?
 
Strange! Are you working on a different machine than before?
And is it the same db you posted before?

yup, i'm working with my laptop which has ms office 2013 and running under windows 8, this is the only way i can test if this module is running in higher version, because the place i'm working have 2003 version.
 
I thought you said it's 2010? So is it 2010 or 2013?
And have you tried it on the db you uploaded here?
 
I thought you said it's 2010? So is it 2010 or 2013?
And have you tried it on the db you uploaded here?

sorry for the miscom it was 2013, and it is same db that i was uploaded before, everything is working fine except the itemclick.
 

Users who are viewing this thread

Back
Top Bottom