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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I set the value of a field based on the value of another field

Status
Not open for further replies.

Chaddio

Technical User
Sep 19, 2005
1
US
Please help!!!

How do I set the value of a field based on the value of another field? I need to set the values in select fields of a table to a certain value depending on the value of a "control" field, and be able to enter any other text if the condition is "false". I have tried IIF function, this does not work due to the above requirement. Any pointers?

Che
 
Welcome to Tek-Tips.
Please read carefully the second FAQ in my sig.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
On your form,in the afterupdate event procedure of the texbox containing the control field you need some code like:

if me.txtcontrolfield = somevalue then
me.txtothercontrol = someothervalue
else
' do nothing
end if
 
To further expand this question, is there any way to make one field in the TABLE pick up a combination of data in a couple of other fields? I've tried all kinds of things, like making it query back on itself. Yeah, that worked real well. In my case, the field currently gets its data after update of the record on a form, but sometimes I do enter data into this table directly (not as wicked as it sounds)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top