listbox columns

G

Guest

I have a form with a listbox on it. In the listbox there are multiple
columns. One column(A) displays revenue while another column(B) is a yes/no.
Under the columnA is a textbox that I would like show the total revenue if
columnB is yes. I am struggling with an expression to display the amt but
getting frustrated in not finding it. Can anyone direct me to see an example
or have a solution to it? Both columns are coming from the same table.
Thanks for the assistance.
*** John
 
D

Douglas J. Steele

I'm assuming that the total won't change depending on what's been selected
in the listbox. If that's the case, you're probably best off using DSum as
the ControlSource for the text box. Something like:

=DSum("[Revenue]", "[MyTable]", "[MyYesNoField] = True")

Include the equal sign. Change the field and table names to match what
you're actually are.
 
G

Guest

Mr Steele, thanks for the info. It works.
*** John


Douglas J. Steele said:
I'm assuming that the total won't change depending on what's been selected
in the listbox. If that's the case, you're probably best off using DSum as
the ControlSource for the text box. Something like:

=DSum("[Revenue]", "[MyTable]", "[MyYesNoField] = True")

Include the equal sign. Change the field and table names to match what
you're actually are.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


JohnE said:
I have a form with a listbox on it. In the listbox there are multiple
columns. One column(A) displays revenue while another column(B) is a yes/no.
Under the columnA is a textbox that I would like show the total revenue if
columnB is yes. I am struggling with an expression to display the amt but
getting frustrated in not finding it. Can anyone direct me to see an example
or have a solution to it? Both columns are coming from the same table.
Thanks for the assistance.
*** John
 

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