List Box

  • Thread starter Thread starter Jasper Recto
  • Start date Start date
J

Jasper Recto

I have a list box that lists out names of reports that can be run. It is
linked to a table that has 3 fields.
Report Description
Report Name
Report Path

I have a button that executes a shell command that runs the program that the
reports are in.

How do I link the list box to the button? I want to be able to pass the
report name and report path to the button. The shell command is already
written to accept a generic report name and path but how do get the button
to know which item in the list box is selected?

Thanks,
Jasper
 
Jasper Recto said:
I have a list box that lists out names of reports that can be run.
It is linked to a table that has 3 fields.
Report Description
Report Name
Report Path

I have a button that executes a shell command that runs the program
that the reports are in.

How do I link the list box to the button? I want to be able to pass
the report name and report path to the button. The shell command is
already written to accept a generic report name and path but how do
get the button to know which item in the list box is selected?

Answered in microsoft.public.access.forms, where you posted this
question independently.That's called "multiposting", and it's generally
frowned on because others don't know what answers have already been
given, and so they duplicate the effort. Also it's harder for you to
keep track of the various replies, and it's harder for later readers of
the question, who may be looking for the same answer, to learn what they
need.

In most cases a single, well-chosen newsgroup will do. If your question
really is relevant to more than one newsgroup, the approved technique is
to "crosspost" it instead, by listing multiple newsgroups in the To: or
Newsgroups: line of a single message. If you do that, the message and
any replies will appear in all the listed newsgroups automatically,
which is beneficial to all concerned.
 
Hi Jasper:

How about this: Set the list box Column Count property to 3 (or 4 if
you have a primary key or autonumber field in the table), and then in
the button click event, read the selected value of the list box using
the list box Column property in code something like:

strReportDescription = lbxMyListBox.Column(1)
strReportName = lbxMyListBox.Column(2)
strReportPath = lbxMyListBox.Column(3)

Hope this helps.

John
 
Sorry

Dirk Goldgar said:
Answered in microsoft.public.access.forms, where you posted this
question independently.That's called "multiposting", and it's generally
frowned on because others don't know what answers have already been
given, and so they duplicate the effort. Also it's harder for you to
keep track of the various replies, and it's harder for later readers of
the question, who may be looking for the same answer, to learn what they
need.

In most cases a single, well-chosen newsgroup will do. If your question
really is relevant to more than one newsgroup, the approved technique is
to "crosspost" it instead, by listing multiple newsgroups in the To: or
Newsgroups: line of a single message. If you do that, the message and
any replies will appear in all the listed newsgroups automatically,
which is beneficial to all concerned.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

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

Back
Top