Jump to content
Sign in to follow this  
benchwrm11

Problems with GetField from a multi-criteria related table

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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

if( not IsEmpty (B::B3)

; B::B3

; ""

)

Well, if it is empty... :hmm:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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