Combining Button Functions

Is it possible to combine button functions? I would like to combine the “Add” and “Back” button functions so that when the “Add” button is clicked the record is inserted to the database and the user is returned to the grid application.

I resolved my issue by adding the following code to the onAfterinsert and onAfterupdate events of my form application:

if ({depart_reason_id} == 0) {
sc_redir(bfa_member_active_grid)
}else{
sc_redir(bfa_member_archive_grid)
}

Now when I click on either the “Add” or “Save” button the form is closed and I’m redirected to the appropriate grid.