Oracle Objects for OLE
Release 9.2

Part Number A95895-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback

Coding the Update Button

See Also
Quick Tour
Employee Form

To code the Update button, we disable the Employee Number text box to disallow changes to this field while updating, since this is a primary key. We also disable the other buttons to disallow other functions such as navigation while updating.

We set the DoUpdate boolean to TRUE, so the commit procedure knows we are updating and not adding a record.

The Update event procedure does the following:

  1. Disables Update button.

  2. Enables the Commit button.

  3. Disables other buttons to disallow functions such as navigation during update.

  4. Disables the Employee Number text box.

  5. Sets the DoUpdate flag to true.

  6. Lets user enter changes.
The Update event procedure looks like:

Private Sub cmdUpdate_Click()

'Disable the Update button and enable the commit button

cmdUpdate.Enabled = False

Commit.Enabled = True

'Disable all other buttons

DisableNavButtons

txtEmpno.Enabled = False

DoUpdate = True

End Sub

The Update and Add event procedures call the DisableNavButtons() subroutine to disable navigation and other functions during an add or update.

Private Sub DisableNavButtons()

'disable all buttons while adding and updating

cmdFirst.Enabled = False

cmdPrevious.Enabled = False

cmdNext.Enabled = False

cmdLast.Enabled = False

cmdFind.Enabled = False

cmdUpdate.Enabled = False

AddNew.Enabled = False

End Sub


 
Oracle
Copyright © 1994, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback