Listbox value to array to table

carl6885

Registered User.
Local time
Today, 10:30
Joined
Nov 16, 2011
Messages
82
Hi All

I have a little problem I am struggling to work out how to do. I think I know the way it should be done (please correct me if I am wrong) but not sure where to start with code:

I have an application that logs errors for my department, on the logging form there is a number affected textbox, when a user enters it a form pops up asking for the policy numbers to be entered (I work for a financial services firm).

What I need is once the user has entered all the policy numbers into the listbox (got that working) these are then saved somewhere to enter into a policy number table with the error id once its generated.

The only way I can think of doing it at the minute is to take the listbox populate an array, then submit the error, use SELECT @@IDENTITY to get the last inserted PK for errors then take the array and populate the policy number table with the error id added to it??

Would that be right? If so could someone give me some pointers on the code?

Thanks in advance.

Carl
 
I'm not sure what you'd need an array for. Is this what you need?

http://www.baldyweb.com/MultiselectAppend.htm

Hi

Thanks for your reply.

I was thinking an array as I am not able to save the policy numbers to a table until I have the error id which will be generated after adding policy numbers and logging the error.

Otherwise how could I get the data from the list box and into the table with the error id I need to reference at a later date??

Thanks
 
I guess I don't understand the process. Can't you still grab the policy numbers from the listbox after entering your error id via whatever method you're using?
 
Maybe i am not sure.

The end user opens the logging form with numerous controls on, the user fills in and when they enter a number affected textbox a new form pops up asking them to enter the policy numbers into it. This could be between 1 and 100 policy numbers. the policy number form is then closed and user continues to fill in the logging form and then hits submit....
 
The new form is the one with the listbox? You could simply hide it instead of closing it, which would leave the selections available.
 
Didn't even think of that!! I'll give a go and report back :)
 

Users who are viewing this thread

Back
Top Bottom