Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning a portion of a field

Status
Not open for further replies.

toddwest

Technical User
Nov 29, 2001
2
US
This is probably a simple question, but I can't seem to find the answer myself....

I'm working on a pharmacology database that holds drug dosage info on a mg/kg basis. My form displays that info in the generic (mg/kg) as well as a patient-weight calculated form (mg ONLY). Here's the question: my dose info (mg/kg or whatever the appropriate units) is stored on a lookup table, so when my calculated value is displayed on the form, it also shows mg/kg when it should only be mg. Is there an elegant way to strip off the "/kg"? I could always create a separate lookup table for the calculated values, but it seems like it should be easier than that. By the way, here is my text box expression if it helps:

="Dosing: " & ([DoseRangeLow]*[Weight]) & " to " & ([DoseRangeHigh]*[Weight]) & [DrugUnits] & " " & [DoseRoute] & " q" & [DoseInterval] & "h"

[DrugUnits] is the field in question.

Thanks in advance for your help,
Todd
 

try this in "BeforeUpdate" or "OnExit" event:
If Right(DrugUnits, 3) = "/kg" Then [DrugUnits] = "kg"

poky
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top