Gasman
Enthusiastic Amateur
- Local time
- Today, 17:06
- Joined
- Sep 21, 2011
- Messages
- 16,555
Good morning everyone,
I am attempting to create a system that will produce letters via a report.
My idea is to have various paragraphs as records, the actual text of the paragraph in a memo field.
I want to be able to show the relevant paragraphs for a type of letter and allow the user to select them via a listbox, much the same as the Access wizards do.
I’ve found code to move items but having problems with my setup?
lstAvailable will be populated from a table with fields
lstSelected would be the same
Now the code I have at present only copies the ID to the lstSelected, when I want all three fields to be copied (or so I believe).
At the same time I want to remove the selected item from the lstAvailable, so it cannot be selected again.
Conversely I will need to do the opposite, remove an entry from lstSelected and put it back into lstAvailable.
I will also need to sort lstAvailable when that happens and I have found code for that.
My problem is that Access states that I must use Value list to use the RemoveItem method, but I need to get my data from the table?
How can I accomplish this please?
I’ve attached a database where I have been trying out the code.
The form is Form1.
TIA
I am attempting to create a system that will produce letters via a report.
My idea is to have various paragraphs as records, the actual text of the paragraph in a memo field.
I want to be able to show the relevant paragraphs for a type of letter and allow the user to select them via a listbox, much the same as the Access wizards do.
I’ve found code to move items but having problems with my setup?
lstAvailable will be populated from a table with fields
Code:
ID Long
Order Integer
ParagraphText Memo
lstSelected would be the same
Now the code I have at present only copies the ID to the lstSelected, when I want all three fields to be copied (or so I believe).
At the same time I want to remove the selected item from the lstAvailable, so it cannot be selected again.
Conversely I will need to do the opposite, remove an entry from lstSelected and put it back into lstAvailable.
I will also need to sort lstAvailable when that happens and I have found code for that.
My problem is that Access states that I must use Value list to use the RemoveItem method, but I need to get my data from the table?
How can I accomplish this please?
I’ve attached a database where I have been trying out the code.
The form is Form1.
TIA