//Check if the user has pressed the Modify Button button
//If Yes validate and modify the company details into the company table
if form(Modify)
if form(txtCompanyName)
//open the an instance of the company table for modifying data
table company=contacts.company
// Move the record pointer to selected record.
company(recordno)=form(recordno)
company(CompanyName)=form(txtCompanyName)
company(Address)=form(txtAddress)
company(City)=form(txtCity)
company(StateorProvince)=form(txtState)
company(Region)=form(txtRegion)
company(Country)=form(txtCountry)
company(PostalCode)=form(txtPostalCode)
company(Website)=form(txtWebsite)
// modify the record
company(modify)
//Check if the records was succesfully modified
if company(recordno)>"0"
"Company modified succesfully
"
else
"Error occured while inserting record !!
"
endif
else
//Give an error messsage to the user
"Company Name cannot be Empty
"
endif
//end further execution
over
endif
//---------------------------------------------------------------------------------------------------------------
//Check if the user has pressed the Delete Button button
//If Yes delete the company details from the company table
if form(Delete)
if form(txtCompanyName)
table delete_company=contacts.company
// To move the record pointer to selected record
delete_company(recordno)=form(recordno)
//to delete the record
delete_company(deleterecord)
//Check if the records was succesfully deleted
if delete_company(recordno)>"0"
"Company deleted succesfully
"
else
"Error occured while deleting record !!
"
endif
else
//Give an error messsage to the user
"Company Name cannot be Empty
"
endif
endif