sc_redir Form to Form

I have 2 forms form_employee {employee_number} INT primary key, autoNumbered and form_address {ID} INT primary key and {employee_number} INT manual_number.

I’ve created a PHP button in the form_employee
sc_redir(form_home, Employee_Number={Employee_Number});

I’ve changed the form_address
SQL
employee_number=[employee_number]

I also sent the global Variable o the form_address as IN

The goal of the form_employee is to pass the {employee_number} to the form_address {employee_number} and if there is a current address to show it, if not to include a new address for that particular employee.

I can’t seem to get the form_employee to pass the {employee_number} … what am I doing wrong?

Not sure. First of all php is case sensitive so {Employee_Number} is something different then {employee_number}. So if you pick up a field from the form be sure that you use the correct name.

Thanks Albert, I’ve tried that and is still not working.

Where is you initializating the variable global [employee_number]?

From a Buttom, you Call a form “form_home” sc_redir(form_home, Employee_Number={Employee_Number});
I can not see where you call the form “form_address”

Hi, In the form_employee - under the button section I entered the PHP code sc_redir(form_home, Employee_Number={Employee_Number});

In the form_home under the SQL tab I enter employee_number=[employee_number], also under the form_home, under global variable I enabled IN.

Am I missing anything?

I see your code is good and must to work…
I think you must test MODE DEBUG your form and so to know if the query is Good.

Thank you so much. How do I conduct test Mode Debug?

Aplication - Settings - Error Settings - Debug Mode. To YES.

Thank you so much. I made it work. I am not sure yet how, but once I figure out what I have done I will post it on this thread.

Ok. Congratulations. :slight_smile:

The issue was in the SQL… I did not set the FK properly in the table, therefore it wasn’t working well. :slight_smile: