Multiselect list to unbound box to query Parameter

G

Guest

I have a multi select list box names "list147" on main form - the records of
which is already selected using ref to another control on the main form _ I
want the records in the list to be selected and sent to a parameter in a
query. Can some pls help with the coding.
The records in the list box are "Numbers" and so is the field in the query
into which I want the parameter setting.

Thanks
Danny
 
G

Guest

Hi Van

Where do I put this code ! in the unbound control box or the list box

Thanks
Danny
 
V

Van T. Dinh

Sorry, I got no ideas of your description since the original post and in the
later post, you added also the TextBox???. Like I wrote, I could only guess
your requirements.

If you need Help, describle clearly your set-up (which seems to involve Form
/ Subform also???) and a separate Query and what you are trying to do.
 
G

Guest

Hi van

I am trying to link all the records in my list box to the records that are
shown in my sub form.

The list box has records "CoCode"

The sub form "EntityList" runs a query that is based on a table called
"ALLDAT"

One of the fields in the table is called "CoCode"

I was trying to show records on my sub form that are based on the list box
i.e. in practice put parameter values in the query using some sort of
automation p which is not based on user inout but based on the relationship
between "CoCde".

The sub form is ok for only 1 CoCode but if I want to get say more than 1
CoCode (selection) coming from the list Box I am stuck

Thanks
Danny
 
V

Van T. Dinh

This won't work with LinkMasterFields / LinkChildFields of the
SubformControl since you have a Multi-Select ListBox and Multi-Select
ListBoxes always have Null value.

You will need to use the code in the link I posted to construct a Query/SQL
String with criteria to select Records in Table ALLDAT according to the
selections in the ListBox and then use this Query / SQL String as the
RecordSource for the Subform.

You can use the ListBox_AfterUpdate Event to run the code even though the
value of the ListBox is always Null, i.e. never gets updated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top