Hi,
I have a form with 2 list boxes. In one box is a list of all motels (the left box). The user can then select any or all of the motels in the left text box and include them in the second list box (the right one). The motels in the second list box will then be used to filter a report.
To help you understand my situation, I have put up a screenshot of the part of my form in question here.
When motel(s) are included in the right text box, they are stored in an array, and when anything is changed, I have code that takes all the motel codes in the array and converts them to a string that can be used in an IN() statement. This IN() statement is used upon the query that the right list box is based upon. Hence the right list box only shows the motels that been included.
It works well for a single user. However, when multiple users are using the one form, I have problems. The good thing is that separate arrays get created for each user, so each user has a different set of motels included, but because the right list box is based on the one query, when one user makes a change it calls the code that produces the IN() statement that the right list box is based on, and hence all other users now see the same list of motels.
Does this make any sense at all?
Any ideas?
Thanks very much,
Peter
P.S. All the code that handle the arrays is in a code module.
P.P.S To me, a simple way around this would be finding a way to populate the list box from the array in code, and bypass the query alltogether. Is this possible?
I have a form with 2 list boxes. In one box is a list of all motels (the left box). The user can then select any or all of the motels in the left text box and include them in the second list box (the right one). The motels in the second list box will then be used to filter a report.
To help you understand my situation, I have put up a screenshot of the part of my form in question here.
When motel(s) are included in the right text box, they are stored in an array, and when anything is changed, I have code that takes all the motel codes in the array and converts them to a string that can be used in an IN() statement. This IN() statement is used upon the query that the right list box is based upon. Hence the right list box only shows the motels that been included.
It works well for a single user. However, when multiple users are using the one form, I have problems. The good thing is that separate arrays get created for each user, so each user has a different set of motels included, but because the right list box is based on the one query, when one user makes a change it calls the code that produces the IN() statement that the right list box is based on, and hence all other users now see the same list of motels.
Does this make any sense at all?
Any ideas?
Thanks very much,
Peter
P.S. All the code that handle the arrays is in a code module.
P.P.S To me, a simple way around this would be finding a way to populate the list box from the array in code, and bypass the query alltogether. Is this possible?
Last edited: