473,387 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dynamic Form Field Query

I have two tables (RadiationOncologists and EvaluationEntry) and forms
for each of the two. My problem is that I have a text box in the
RadiationOncologists form that is called Number. This field needs to
dynamically count each instance of a certain doctors name from the
EvaluationEntry table which is RADLNAME and return the total for each
doctor listed as there record in the RadiationOncologist Form appears.
I can do a count of all listed doctors by either total or from a
query that will list all of the drs with their totals but can't seem
to figure out how only do the calculation for the current doctor
listed.

Here is the SQL code i have to get the count to work

SELECT Count(EvaluationEntry.RADLNAME) AS CountOfRADLNAME,
EvaluationEntry.RADLNAME
FROM EvaluationEntry INNER JOIN RadiationOncologists ON
EvaluationEntry.RadID = RadiationOncologists.RadID
GROUP BY EvaluationEntry.RADLNAME;

I believe the group by could go away if there was a WHERE statement
stating to us the current RadiationOncologists.RADLNAME
Nov 12 '05 #1
4 2096
Bob:

You can refer to a control on an *open* form using this syntax:
Forms![FormName]![ControlName]

So, to get the count for only the doctor displayed, your SQL would
be something like:

SELECT Count(EvaluationEntry.RADLNAME) AS CountOfRADLNAME,
EvaluationEntry.RADLNAME
FROM EvaluationEntry
WHERE (EvaluationEntry.RADLNAME =
Forms![NameOfRadiationOncologistsForm!]![NameOfRADLNAMEControl]);

You could make that query the Record Source for a subform, and then
display the subform on the parent form that shows the
RadiationOncologists data.

-Matt
On 31 Mar 2004 18:18:29 -0800, hi*******@yahoo.com (bob hicky) wrote:
SELECT Count(EvaluationEntry.RADLNAME) AS CountOfRADLNAME,
EvaluationEntry.RADLNAME
FROM EvaluationEntry INNER JOIN RadiationOncologists ON
EvaluationEntry.RadID = RadiationOncologists.RadID
GROUP BY EvaluationEntry.RADLNAME;


Nov 12 '05 #2
Matt,
Thanks so much, I figured out how to do it with an expression but this
clears up how to do it with a SQL query. Appreciate the help, sometimes
being a newbie is more painful on others than it is the newbie.

Rob


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
Matt,
Thanks so much, I figured out how to do it with an expression but this
clears up how to do it with a SQL query. Appreciate the help, sometimes
being a newbie is more painful on others than it is the newbie.

Rob
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #4
Everyone was a noob once... ;-)

On 04 Apr 2004 06:17:32 GMT, bob hicky <hi*******@yahoo.com> wrote:
Matt,
Thanks so much, I figured out how to do it with an expression but this
clears up how to do it with a SQL query. Appreciate the help, sometimes
being a newbie is more painful on others than it is the newbie.

Rob
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jack | last post by:
Hi, I am trying to test a sql statement in Access which gives me the error as stated in the heading. The sql statement is built as a part of asp login verification, where the userid and password...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
by: Richard Hollenbeck | last post by:
Hello Newsgroup. You have all been very helpful in the past and I thank you. I try to ask relevant questions so that they don't just benefit me, but also benefit the group. I'm currently...
3
by: Peter Bailey | last post by:
Could someone please tell me how to pass criteria as if it were a parameter. I have a routine now that creates the sql string (well almost). at present the parameter is so I can pass one item ie...
0
by: starace | last post by:
I have designed a form that has 5 different list boxes where the selections within each are used as criteria in building a dynamic query. Some boxes are set for multiple selections but these list...
3
by: deejayquai | last post by:
Hi I've created a crosstab query and displayed it as a sub-report in my main report. This is fine until the data changes and the column names become incorrect. I know I have to create a...
2
by: deejayquai | last post by:
Hi I'm trying to produce a report based on a dynamic crosstab. Ultimately i'd like the report to actually become a sub report within a student end of year record of achievement. The dynamic...
9
by: Jimbo | last post by:
Hello, I have a user request to build a form in an Access database where the user can check off specific fields to pull in a query. For example, let's say I have 10 fields in a table. The user...
13
by: salad | last post by:
Operating in A97. I didn't receive much of a response conserning Pivot tables in Access. Pivot tables are nice, but a CrossTab will work for me too. Using a Pivot table, one is actually...
4
by: Philip_collins | last post by:
Hi! I have a dynamic query that has a form attached. I want to add up a field with the sum funtion, the field is netkg. Dim rec As Recordset Dim qdf As QueryDef Dim strsql Set db =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.