How to call a form from a button (New and Update)

Hi All,

Getting a bit frustrated here.

I have a login screen, and I want to allow users to register before logging in, so I have a button on the login form page to achieve this.

Under the code for the button I put this code and it seems to work.

sc_apl_conf(“form_accts”,“start”,“new”);
sc_redir(“form_accts”);

Once they have registered and have logged in, I present them with a grid and on the toolbar of the grid I have a button to allow them to edit their “registered” information.

Under the code for the button I put this code and it just does not work.

sc_apl_conf(“form_accts”,“insert”,“off”);
sc_apl_conf(“form_accts”,“update”,“on”);
sc_redir(form_accts,acct_id=[acct_id]);

The [acct_id] is a global variable that contains the primary key field to locate their record, and in the SQL menu item on the IDE left pane for the actual form, I inserted a WHERE clause

ac_id = [acct_id]

However, when I click on the button to edit the record, the form appears, empty, with no Update button.

What am I doing wrong? I just want two buttons, one on each application toolbar, one to add a new record in one application and another button on another application, to allow the record to be updated.

Thanks

Tony

PS. Also is there a way to detect inside form application if it a “new” or “update” that is being requested?

Success - It was some form of corruption in the generated files that would just not be overwritten. So, I just started a new form application and it all worked OK. Pity about the past two days though.

Actually, it was not fixed, but upon further investigation I located the problem.

I wanted a second login screen for a special group of users. I copied the app_Login security app and did not realize (until the blinkers came off) that in the onload event there was a command

sc_apl_conf(“form_accts”,“start”,“new”);

That needed to go, and all was sweet afterwards.

Tony