By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

How to count a text field in a form

P: n/a
I have two forms. Form-1 has a combo box, the selection from the combo box
populate form-2

Example form-1 Form- 2
Text1 Text2 Text3
Drop down contain text fields NA Sep Jar
NA -- -- ---
sep na
Jars sep
na
jar
Total?
How do i sum the total in form-2, since the selection in the combo box is
defined as a text.

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
wait... you're trying to do sums on text? They can't even be
represented as numbers like this... if they're numbers stored in text
fields, you can convert them with CInt(txtFieldName) or CSng() etc.

Nov 13 '05 #2

P: n/a
The combox field is defined as a text,I want to count how many times this
fields in the combo was selected. Example, the combox contain fields
selection of A, B, C. I want to get the total count of A, B, and C
whenever it is selected. Thanks

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #3

P: n/a
ja
>The combox field is defined as a text,I want to count how many times this
fields in the combo was selected. ???????? confusing, confusing and confusing. If combox is a field. what is
combo? here is something, if you're trying to get the count of the
values in the combox field, try this:

SELECT Count(*) as valuecount, tablet.combox
FROM tablet
GROUP BY tablet.combox
ORDER BY tablet.combox;
I want to get the total count of A, B, and C
whenever it is selected. see the sql code above.

I hope this helps.
On Thu, 09 Jun 2005 14:38:20 GMT, "Frank O'Neil via AccessMonster.com"
<fo***@AccessMonster.com> wrote:
The combox field is defined as a text,I want to count how many times this
fields in the combo was selected. Example, the combox contain fields
selection of A, B, C. I want to get the total count of A, B, and C
whenever it is selected. Thanks


Nov 13 '05 #4

P: n/a
It does not work. I want the total in form 2 using the selection from
form1. This is the code that i used in the control source of text1, and
text2 in form-2 to get the count from form1 whenever the selection from
the combox that populate form2. Then, I will sum the result of the two
count, however, this does not work.

=DCount("[test1]","sales","[test] = 'A' '" &
[Forms]![Form1]![cboD].(1) & "'")

=DCount("[test1]","sales","[test] = 'B' '" &
[Forms]![Form1]![cboD].(2) & "'")

..
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.