PDA

View Full Version : Solved: Edit in ListBox & changes made to RowSource



tccmdr
06-19-2007, 12:07 AM
Gurus:bow:

I have a ListBox, its rowsource is a defined range on worksheet 'n'.

I would like to be able to use the ListBox_DblClick() to amend information and have the change occur in the defined range as well.....

Is this possible:think:

Bob Phillips
06-19-2007, 01:03 AM
yes, you just change the sheet data if it is bound, the listbox will reflect the changed.

tccmdr
06-19-2007, 03:29 AM
Mr.X

I want to be able to change the sheet data from the listbox using the DblClick() event....:think:

Bob Phillips
06-19-2007, 03:37 AM
That's what I said.

tccmdr
06-19-2007, 04:09 AM
Sorry Mr.X, but I don't think I'm explaining myself well enough:wot

When the listbox displays the sheet data, I want to be able to double click a listbox item and enter the listbox to make changes, not the sheet data

I hope I'm not frustrating you too much:banghead:

Charlize
06-19-2007, 04:36 AM
If you have a unique value (I usually use the rowno), you can use this to look for that value in your sheet and alter the info which you have put in a variable (using an inputbox or form) when doubleclicking the listbox .

tccmdr
06-19-2007, 05:17 AM
Charlize,

Thanks for your input: pray2:

Is an example possible:whistle:

Charlize
06-19-2007, 01:54 PM
If you would post a workbook sample, I could (and probably will) take a look at it and build it in for you. Don't know how your data is setup. So to avoid layout problems, it's best to give a sample.

tccmdr
06-19-2007, 04:17 PM
Charlize,

I've tried to attach a sample for you, however, this PC is having a "Security" issue:



Access Denied The requested document, http://vbaexpress.com/forum/newattachment.php (http://vbaexpress.com/forum/newattachment.php), will not be shown.

Reason: DDR Request score = 13.


The idea is to keep the actual datasheet very hidden and make changes through the listbox:think:

lucas
06-20-2007, 08:31 AM
What you have to do is call another userform that populates textboxes with the selection from your listbox...edit in the new userform and with a command button tell it to edit the changes on the worksheet which will be reflected in your listbox info..

see attached example....it is an address book but it has a good example of what your trying to do. When the form loads make a selection in the listbox and then hit edit selection....that opens a new userform4 which populates the textboxes(which you can edit) with data from the selection in the listbox...etc...the command button on userform4 changes that data on the sheet and the listbox will reflect the changes.

lucas
06-20-2007, 08:32 AM
I'm sure you could use a double click event to open the userform4 for edit...

tccmdr
06-20-2007, 03:54 PM
Just what I needed.....and more:p


:clap: The assistance on this site is just brilliant:clap:


I'm going to have to donate now....thanks again
:friends: