Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2006

Tip: Looking for answers? Try searching our database.

Body Surface area code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RobUCSD - 23 Dec 2006 03:47 GMT
I need have a calculated field based on hight and wt in inches and pounds.
Can anyone help implement this?

Thanks and Happy Hollidays!

RobUCSD

BSA (m²) = ( [Height(in) x Weight(lbs) ]/ 3131 )½
John Nurick - 23 Dec 2006 06:16 GMT
>BSA (m²) = ( [Height(in) x Weight(lbs) ]/ 3131 )½

    Sqr(([Height] * [Weight])/3131)

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
RobUCSD - 23 Dec 2006 17:11 GMT
Thankyou John for your help. I tried inserting
=Sqr(([fldHeightInches]*[fldWeightPounds])/3131) in the default value
property of fldBSA. I get an error msg that says that the database does not
recognize the field fldHeightInches or the table tblClinicalPresentation.  
any suggestions?

FYI I know you're not supposed to store the value of a calculated field in a
field, but I need the field with the BSA for statistical purposes.

Thanks, RobUCSD

> >BSA (m²) = ( [Height(in) x Weight(lbs) ]/ 3131 )½
>
[quoted text clipped - 4 lines]
>
> Please respond in the newgroup and not by email.
Douglas J. Steele - 23 Dec 2006 18:53 GMT
Create a query that has that calculation in it. Use the query wherever you
would otherwise have used the table.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> Thankyou John for your help. I tried inserting
> =Sqr(([fldHeightInches]*[fldWeightPounds])/3131) in the default value
[quoted text clipped - 17 lines]
>>
>> Please respond in the newgroup and not by email.
RobUCSD - 23 Dec 2006 22:33 GMT
Hello Again Doug. I tried insterting the calculation into the query but have
had no luck. Is there some kind of lead in to call a calculation for a field
in sql?

Your help is greatly appreciated,

Rob

> Create a query that has that calculation in it. Use the query wherever you
> would otherwise have used the table.
[quoted text clipped - 20 lines]
> >>
> >> Please respond in the newgroup and not by email.
Douglas J. Steele - 24 Dec 2006 00:16 GMT
How did you insert the calculation?

It should be as simple as putting

BSA: Sqr(([Height] * [Weight])/3131)

into an empty cell on the Field row of the grid (assuming you have fields
named Height and Weight in your table).

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> Hello Again Doug. I tried insterting the calculation into the query but
> have
[quoted text clipped - 33 lines]
>> >>
>> >> Please respond in the newgroup and not by email.
RobUCSD - 24 Dec 2006 04:19 GMT
It just doesn't work in the query. I get the error msg that the expression is
too complex.

Is there a way I could do this thru code on the form?

Thanks for your help

> How did you insert the calculation?
>
[quoted text clipped - 42 lines]
> >> >>
> >> >> Please respond in the newgroup and not by email.
John Nurick - 24 Dec 2006 07:27 GMT
Can you show us the SQL of the query?

>It just doesn't work in the query. I get the error msg that the expression is
>too complex.
[quoted text clipped - 49 lines]
>> >> >>
>> >> >> Please respond in the newgroup and not by email.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
RobUCSD - 25 Dec 2006 00:58 GMT
here's the query as requested. thanks for your help with this

SELECT tblClinicalPresentation.fldCPNo, tblClinicalPresentation.fldVisitNo,
tblClinicalPresentation.fldHeightInches,
tblClinicalPresentation.fldWeightPounds, tblClinicalPresentation.fldBSA,
tblClinicalPresentation.fldRhythm, tblClinicalPresentation.fldAFibType,
tblClinicalPresentation.[fldEpisodes>72hrs],
tblClinicalPresentation.fldNoWeeksOfAfib,
tblClinicalPresentation.fldNoYearsOfAfib,
tblClinicalPresentation.fldSeverityOfPalpitation,
tblClinicalPresentation.fldSeverityOfFatigue,
tblClinicalPresentation.fldSeverityOfSOB,
tblClinicalPresentation.fldSeverityOfDizziness,
tblClinicalPresentation.fldSeverityOfLackOfEnergy,
tblClinicalPresentation.fldHistoryOfCardioversion,
tblClinicalPresentation.fldAfibFrequency
FROM tblClinicalPresentation
WHERE
(((tblClinicalPresentation.fldBSA)=Sqr(([fldHeightInches]*[fldWeightPounds])/3131)));

> Can you show us the SQL of the query?
>
[quoted text clipped - 56 lines]
>
> Please respond in the newgroup and not by email.
John Nurick - 25 Dec 2006 07:42 GMT
Hi Rob,

The SQL you posted will return all records from tblClinicalPresentation
where the the value of the field [fldBSA] is equal to the surface area
calculated from [fldHeightInches] and [fldWeightPounds]. As I understand
it, you don't have a BSA field, so that is presumably the problem. To
calculate BSA, the query should be like this:

SELECT tblClinicalPresentation.fldCPNo,
 tblClinicalPresentation.fldVisitNo,
 tblClinicalPresentation.fldHeightInches,
 tblClinicalPresentation.fldWeightPounds,
 Sqr([fldHeightInches]*[fldWeightPounds]/3131) AS BSA,
 ...
 FROM tblClinicalPresentation
;

>here's the query as requested. thanks for your help with this
>
[quoted text clipped - 76 lines]
>>
>> Please respond in the newgroup and not by email.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
RobUCSD - 25 Dec 2006 13:40 GMT
Dear MS Access MVP's, thankyou all for  what you do. Thankyou John for your
help, the solution you gave works perfectly. Merry Christmas to everyone and
may 2007 be a very prosperous and peaceful year for you and your families.

Rob

> Hi Rob,
>
[quoted text clipped - 98 lines]
>
> Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.