Adding new User to program

Yohn

Member
Hy

I created application updates table users. This starts on button Update. Now I want to create new button called New to insert new User, but with program for update. How I can do this? Code for this button starts like this:

on choose of btn_nk do:
find last user.
create systemuser.
run change.w(systemuser.name).

is this good code for that button?
 
A better approach will be to first check the wether any existing user's exists with name.

Eg. Ask the user to input the new user name...

on choose of btn_nk do:
find first systemuser where user_id = name:screen-value no-lock no-error.
if not available systemuser then do :
create systemuser.
run change.w(systemuser.name).

end. /* Then do: */

else
Message " User already Exists----------".
 
Back
Top