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

calculated form

P: n/a
Friends, I have a table with a field named Initials which has its
record source to another table named Initials.
I would like to add on a form named Welcome two controls:
A combo box, which displays the initials of all my database users and
a text box which calculated the number of records associated to the
selected user.

I would like to use the OnChange event of the combo to run the query
or the calculation code.

Is there a way I can do this?

Thanks.
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Add the combo box to the form. Set its Row Source to a query that returns
the initials from the table that lists the initials. The wording in your
first sentence is confusing. Is the Initials field the field that the two
tables are joined on? Is the table that lists the initials also called
initials?

Example:
SELECT [Initials].[Initials] FROM [Initials] ORDER BY [Initials]

Then add the textbox. Set the Control Source of the textbox to

=DCount("*", "[NameOfOtherTable]", "[Initials]='" & cboNameOfCombo & "'")

This will make the textbox a calculated control. You shouldn't need a VBA
event to do this.

--
Wayne Morgan
Microsoft Access MVP
"Paolo" <jp***@tin.it> wrote in message
news:9f**************************@posting.google.c om...
Friends, I have a table with a field named Initials which has its
record source to another table named Initials.
I would like to add on a form named Welcome two controls:
A combo box, which displays the initials of all my database users and
a text box which calculated the number of records associated to the
selected user.

I would like to use the OnChange event of the combo to run the query
or the calculation code.

Is there a way I can do this?

Thanks.

Nov 13 '05 #2

P: n/a
One other way would be to use a totals query for the source of your combo.
In the query add the Initials field twice to the control grid. Under the
first set it to GroupBy under the second set it to Count. Now set the
control source of you unbound text box on your form to:
=([MyCombo].Column(1))

--
Reggie

----------
"Wayne Morgan" <co***************************@hotmail.com> wrote in message
news:fy***************@newssvr17.news.prodigy.com. ..
Add the combo box to the form. Set its Row Source to a query that returns
the initials from the table that lists the initials. The wording in your
first sentence is confusing. Is the Initials field the field that the two
tables are joined on? Is the table that lists the initials also called
initials?

Example:
SELECT [Initials].[Initials] FROM [Initials] ORDER BY [Initials]

Then add the textbox. Set the Control Source of the textbox to

=DCount("*", "[NameOfOtherTable]", "[Initials]='" & cboNameOfCombo & "'")

This will make the textbox a calculated control. You shouldn't need a VBA
event to do this.

--
Wayne Morgan
Microsoft Access MVP
"Paolo" <jp***@tin.it> wrote in message
news:9f**************************@posting.google.c om...
Friends, I have a table with a field named Initials which has its
record source to another table named Initials.
I would like to add on a form named Welcome two controls:
A combo box, which displays the initials of all my database users and
a text box which calculated the number of records associated to the
selected user.

I would like to use the OnChange event of the combo to run the query
or the calculation code.

Is there a way I can do this?

Thanks.


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.