benchwrm11 Posted July 27, 2012 Posted July 27, 2012 Hello, I'm adding a field to an existing database. I'd like this field to get a value from a field in another table based on two criteria. The tables (A and B are related by two criteria (1 and 2). Right now I have: If ( A1 = B::B1 AND A2 = B::B2; GetField ( B::B3 );"") But nothing happens. I'm a novice, so any suggestions on better code would be greatly appreciated.
comment Posted July 27, 2012 Posted July 27, 2012 It would probably be better to define a relationship between the two tables, based on matching the two fields. Then either place the third field on your layout, or fetch it through a calculation field. Note also that the GetField() function is not required here and will not work the way you have used it. P.S. Please use meaningful names for your tables and fields - we are not robots.
beverly Posted July 28, 2012 Posted July 28, 2012 so, if you have two tables: A, B and you have the relationship (A::A1= B::B1 AND A::A2=B::B2), the VALID relationship is already set up. Just put the B::B3 field on the layout based on that relationship, as Comment says. no need for IF, no need for get field. or create a calculation: if( not IsEmpty (B::B3) ; B::B3 ; "" ) Beverly 1
comment Posted July 28, 2012 Posted July 28, 2012 if( not IsEmpty (B::B3) ; B::B3 ; "" ) Well, if it is empty... :hmm:
benchwrm11 Posted August 3, 2012 Author Posted August 3, 2012 Just had to recheck my relationships. Thank's everbody for the help
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now