Jump to content
Server Maintenance This Week. ×

Problems with GetField from a multi-criteria related table


This topic is 4285 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

This topic is 4285 days old. Please don't post here. Open a new topic instead.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.