Fetch Record for IF statement

Fetch Record for IF statement


I am trying to figure out how to Fetch specific fields from another form, to implement IF statements in the first form.

For example:

Two forms:  STAFF and RECORDS

In Staff form is:  NAME, Position type, and several Decision boxes -- Do you want to receive email if EVENT A, EVENT B, EVENT C

In the RECORDS form:  There are many fields, one is STATUS.  So, if STATUS changes from NONE to EVENT A or EVENT B, or EVENT C, I want   the database to go through each Position_Type, and depending on the NAME and if they selected to receive email, then they get an email.

So my main problem is that I cant figure out how to pull a specific TURE/FALSE value from the decision box in the STAFF for my IF statement.

This is what I came up with in my head,  but it will not work -- obviously because I cant figure out how to use the FETCH RECORD statement.  I think it gets pretty complicated, because depending on the STATUS, it has to go through the three or four different staff types, and figure out of each person who is selected wants to be notified


On Submit of Records form:

if(input.Status == "Holding")
{
   if(Add_Delete_Staff[Anes_Name == input.AnesName];  
   {
       if(Add_Delete_Staff[EMAIL_Pt_in_Holding == true])   // trying to see how I can verify just this one field on the STAFF form
         {

           sendmail
            (
                To       :   user@email.com
                From     :  zoho.loginuserid 
                Subject  :  "Your Pt is Here" 
                Message  :  Holding 1
            ) 
          }
    }

                                            
   if(Add_Delete_Staff[Surg_Name == input.SurgName];         // Repeat for the next staff type
   {
       if(Add_Delete_Staff[EMAIL_Pt_in_Holding == true])   
         {

           sendmail
            (
                To       :   user@email.com
                From     :  zoho.loginuserid 
                Subject  :  "Your Pt is Here" 
                Message  :  Holding 1
            ) 
          }
    }