Listbox newbie...help!! :-)

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

Hello all,
Can you give me a bit of advice on how to achieve the
following:
I've got a listbox that lists various names of people.
I'd like the user to be able to select a number of the
people and then for the system to print an address label
for each of them. I've obviously got the multi-select
property set (to simple) but I'm struggling with how to
work with the selected values. I've tried a For/Next
loop, saved the values in a variable (called strWhere)
and then put this at the end of an SQL query but this
doesn't work...I'm making it up as I go and obviously
failing!! Can you help explain what I need to do?
Please keep it simple as I'm struggling with this!!

Thanks in advance,

Lee
 
Hi Lee,

It sounds like you've got the right approach - but you probably have a
syntax or logic error somewhere in your code - you need to post your code so
we can see what you are doing and what might be wrong. Also, when you say it
doesn't work, please explain what does happen including any errors that
occur.

You might also want to refer to this article which contains of working
example what you are trying to do:
http://www.mvps.org/access/reports/rpt0005.htm
 
Lee said:
Hello all,
Can you give me a bit of advice on how to achieve the
following:
I've got a listbox that lists various names of people.
I'd like the user to be able to select a number of the
people and then for the system to print an address label
for each of them. I've obviously got the multi-select
property set (to simple) but I'm struggling with how to
work with the selected values. I've tried a For/Next
loop, saved the values in a variable (called strWhere)
and then put this at the end of an SQL query but this
doesn't work...I'm making it up as I go and obviously
failing!! Can you help explain what I need to do?
Please keep it simple as I'm struggling with this!!

Can you post the code? It would make things easier.

Andy
 
Thanks for the reply, it's much appreciated.
Having looked at the code at the website you suggested, I
can see that I wasn't using the 'IN' statement (I've not
come across this before).
I've got my labels form working a treat now so thanks
again for your help!!

Best regards,

Lee
-----Original Message-----
Hi Lee,

It sounds like you've got the right approach - but you probably have a
syntax or logic error somewhere in your code - you need to post your code so
we can see what you are doing and what might be wrong. Also, when you say it
doesn't work, please explain what does happen including any errors that
occur.

You might also want to refer to this article which contains of working
example what you are trying to do:
http://www.mvps.org/access/reports/rpt0005.htm


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
Hello all,
Can you give me a bit of advice on how to achieve the
following:
I've got a listbox that lists various names of people.
I'd like the user to be able to select a number of the
people and then for the system to print an address label
for each of them. I've obviously got the multi-select
property set (to simple) but I'm struggling with how to
work with the selected values. I've tried a For/Next
loop, saved the values in a variable (called strWhere)
and then put this at the end of an SQL query but this
doesn't work...I'm making it up as I go and obviously
failing!! Can you help explain what I need to do?
Please keep it simple as I'm struggling with this!!

Thanks in advance,

Lee

.
 
Back
Top