OK, so I’ve got a listbox that has a list of directories. Using doubleclick along with the combination of cellclick with “'cellName = me.cell(row, column)”, I can successfully double click on the directory name in the cell and pop open the full path in Windows Explorer (the directories in the list box are the last directories in the path). I’m trying to accomplish the same thing when you tab into the listbox and move up and down with the arrow keys. I want to be able to hit return/enter and pop open the whole path, just like with the mouse. I’ve got the return/enter key portion working, but it never grabs the cell name which contains the last directory in the path. Windows explorer is always one directory up from where I want it. I’ve tried using “'cellName = me.cell(row, column)” in the event handlers where I thought they might work, like cellgotfoucs, keycelldown, keylostfocus, and celltextchange. None of these work at getting the cell name, as they did with the mouse and cellclick.
So to sum it up, everything is working except grabbing the cell name when using the arrow keys to select a cell.
I’m sure it’s something simple I’m overlooking. This is the first time I’ve tried to do this with the keyboard.
[quote=473972:@JulianS]It sounds like the issue you have is that message is triggering on cursor presses when you want it to only trigger on Enter, try this in the KeyDown event
If key = chr(13) Or key = chr(3) Then '13 = enter and 3 = numpad enter
That’s it! I ditched tying the “cellName = me.cell(row, column)” to an event handler (although this worked with the mouse) and used “Me.SelectedRowValue” instead right in the keydown portion where I link the various fields together to form the whole path.
Thank you, Julian!
Also, thanks for showing me the message log. I had only used “break” up till now!