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

Comparing Access fields to give value to another field

Status
Not open for further replies.

webstaff

Technical User
Jan 2, 2003
97
GB
Hi guys

Im in need of a little Access help??

I have a field in my table that needs to be filled by comparing two other fields and if they match take the value of a third field..

Does that make sence?
I tryed the following as the empty fields default value but its not correct.

"=[field_title] where [field_dam] = [field_id]"

Any suggestions are welcome.
Regards as ever
Les
 
Try this in the control source of your new field:

=iif([field1] = [field2],[field3],"")

in this statement I'm assuminig if field1 and field2 aren't equal you want the field to be blank "", but you can change this with whatever you want.
 
Im not sure im with you,

I have a field father and its value is numeric, this numeric value will be equal to one of the values in the field_id which is the primary key.

I want to take the fathers value,, match it in the field_id and show the value of the field_title

so in the Field_titles default value in desighn view i was trying to add
"=[field_title] where [field_father] = [field_id]"

regards
 
I think I'm not following you. Are you looking this value up in a table? Where is the field father come from? Is it a field that is entered on your form or is a field on a table? I'm guessing it is a field on your form. Then, is field_id and field_title on a table? Finally, when you display field_title is it really a default value or is it the value that you want it the field that cannot be udpated? Are you displaying this new field or do you just want the value to be stored somewhere?

If field father is a field that is entered on a form and then you lookup in a table to lookup the field id and find the field title then you need to go to your row source and select field_title from tblYourTable where field_id = me.yourformfieldname.

Has this helped you or have I completely misunderstood your question?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top