Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editable Listbox 2

Status
Not open for further replies.

arimatan

Programmer
Jun 30, 2003
8
DE
Hi all,

does anyone out there know if it is possible to implement an editable listbox in Access?
I have a multi-column listbox and one column's values should be editable for the user at runtime.
A simple datasheet (sub)form wouldn't fit my needs, that's why I'm thinking about such horrible stuff like programming an editable listbox.

any help, experiences or hints would be greatly appreciated :)
 
Hi

Can you use a combo box?, which is a combination between a textbox and a list box?

If not you could mock something up using a text box and a list box I would have thought, but why can you not use a subform control?

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi Ken,

thanks for your reply. The listbox is populated by a query and can have thousends of rows and up to ten columns. So a combobox is unsuitable.

I also thought about using a textbox beside the listbox to enter the values, but in this case I would need as many textboxes as the number of listbox rows (which is not a fixed value) and I have no idea how to do that.
Only one textbox for all rows isn't enough, because the user should see all the inputs he made previously while working through the listbox rows. In case of only one textbox for user input I would have to requery the listbox after each update, which would cause tremendous traffic.

What do you mean by "subform control"? As I said a Datasheet View is not what I want, e.g. because I cannot set only one column editable in a updateable snapshot. Only all or none (snapshot). Or am I wrong here?

thanks for reading
cheers
arimatan
 
Hi

Well "wrong" is not the word I would use, but it sounds to me as if a subform control containing a form in datashet view will do waht you want, You can set individual columns to be locked (ie none updateable) if you want to.

You will find the subform control on teh standard Access toolbox, it is simply a container which will allow you to put another form within your 'main' form. You can choose to allow new rows to be inserted or not as you wish. The only down side I can think of in your example, is that new inserted rows appear at the end of the list rather in their correct logical position according to the OrderBy of the underlying query. You could provide a 'refresh' button to requery the form, thus putting everything in order, at the cost of the processing/network traffic, provision of a button would allow the usr to decide if they wanted to put if the out of order list or suffer the daly of waiting for it to be re-ordered

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi Ken,

I didn't know that it's possible to set individual columns to be locked. Can you please tell me how to do this?
I've never worked with Datasheet forms before...
Recordset Type is set to updateable snapshot but I don't know how to set a specific column read-only.

Thanks in advance
 
Hi

Design the form as if it was a 'normal' form view form, except you do not need to fuss about lining things up. Set the Enabled property to false, and the locked property to true of those columns you do not want to be updatable. In the properties of the form set views allowed, and default view to datasheet. That is it!, other than using format menu option in the normal way to move columns around in datasheet view



Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top