Calculated Field Using If (1 Viewer)

Rich_Lovina

Registered User.
Local time
Tomorrow, 00:52
Joined
Feb 27, 2002
Messages
225
I have three fields in a form which I want to yeild a fourth field result, based upon text data entered in 1,2 and 3, such that:

Field1=CM, Field2=DM, Field3=NM, or
Field1=CM, Field2=NM, Field3=NM.
or Field1=CM, Field2=DM, Field3=' '
I want the result in GlobalField to run with Field3 always, if not blank, then if blank use Field2, and if 3 and 2 are blank, then use Field1.

Where do I enter the formula and what is it?
 

charityg

Registered User.
Local time
Today, 15:52
Joined
Apr 17, 2001
Messages
634
if field3<> "" then
globalfield="whatever"
elseif field2<>"" then
globalfield="whatever"
endif
else
globalfield="whatever"
endif

put this code in the oncurrent event of the form and also in the afterupdate events of fields1,2, and 3. There is probably a slicker way to do this, but this should work. Not guaranteed bugfree (I'm not 100% sure about the elseif line) but you get the idea.
 

Users who are viewing this thread

Top Bottom