PDA

View Full Version : Solved: Searh and edit record from listbox



tlchan
12-11-2008, 09:24 AM
Hi there,

I used the code from forum for editi of database on selected record through display in listbox after search event.

The problem is when select the record for edit, return error as "Could not get the list property. Invalid property array index" The search type can be any item in the sheets("ALLSSE").


Can anybody help me out ?

Thanks
:dunno
workbook attached

Bob Phillips
12-11-2008, 09:54 AM
I have just run it and it works fine for me.

nst1107
12-11-2008, 10:19 AM
You get your error here: .Tbname.Value = FrmMain.ListBox1.List(ListIndex + 1, 2)

The problem is you are using ListIndex as a Variant and haven't given it a value. I think ListBox1.ListIndex is what you're looking for.

nst1107
12-11-2008, 10:27 AM
Actually, that won't work, either. ListBox1 also needs an object qualifier. And the List and ListIndex properties both use base 0, so adding 1 to the ListIndex won't get you the entry you want and can cause errors as well. This works: .Tbname.Value = FrmMain.ListBox1.List(FrmMain.ListBox1.ListIndex, 2)

tlchan
12-12-2008, 08:16 AM
Yes,It works and solved my problem.

Thanks nst1107 solution came to my recue. :thumb

msbharani
12-12-2008, 08:28 PM
Superb response