VBSample project - Technical -frmemployee - Controls
Controls of frmemployee


cmdCancel


private sub cmdCancel_Click( )


General information

Full name cmdCancel.cmdCancel_Click
Access private
Overload of  

Source code

Private  Sub cmdCancel_Click()
   On Error  Resume  Next
  SetButtons  True
  mbEditFlag =  False
  mbAddNewFlag =  False
  adoPrimaryRS.CancelUpdate
   If mvBookMark >  0  Then
    adoPrimaryRS.Bookmark = mvBookMark
   Else
    adoPrimaryRS.MoveFirst
   End  If
  mbDataChanged =  False
End  Sub

Functions and events referenced

Full name Owners
Recordset.MoveFirst Recordset
Recordset.CancelUpdate Recordset
frmemployee.SetButtons frmemployee

Referenced classes

Full name
adoPrimaryRS

Referenced properties

Full name Scope
frmemployee.mbDataChanged attribute
Recordset.Bookmark attribute
frmemployee.mvBookMark attribute
frmemployee.mbAddNewFlag attribute
frmemployee.mbEditFlag attribute



cmdUpdate

private sub cmdUpdate_Click( )


General information

Full name cmdUpdate.cmdUpdate_Click
Access private
Overload of  

Source code

Private  Sub cmdUpdate_Click()
   On Error GoTo UpdateErr
  adoPrimaryRS.UpdateBatch adAffectAll
   If mbAddNewFlag  Then
    adoPrimaryRS.MoveLast
   End  If
  mbEditFlag =  False
  mbAddNewFlag =  False
  SetButtons  True
  mbDataChanged =  False
  Exit  Sub
UpdateErr:
  MsgBox Err.Description
End  Sub

Functions and events referenced

Full name Owners
frmemployee.SetButtons frmemployee
Recordset.MoveLast Recordset
Recordset.UpdateBatch Recordset

Referenced classes

Full name
adoPrimaryRS

Referenced properties

Full name Scope
frmemployee.mbDataChanged attribute
frmemployee.mbEditFlag attribute
frmemployee.mbAddNewFlag attribute



cmdClose

private sub cmdClose_Click( )


General information

Full name cmdClose.cmdClose_Click
Access private
Overload of  

Source code

Private  Sub cmdClose_Click()
  Unload Me
End  Sub

Functions/Events referencing

Full name Owners
frmemployee.Form_KeyDown frmemployee

Referenced classes

Full name
frmemployee



cmdRefresh

private sub cmdRefresh_Click( )


General information

Full name cmdRefresh.cmdRefresh_Click
Access private
Overload of  

Source code

Private  Sub cmdRefresh_Click()
   On Error GoTo RefreshErr
   Set grdDataGrid.DataSource = Nothing
  adoPrimaryRS.Requery
   Set grdDataGrid.DataSource = adoPrimaryRS
  Exit  Sub
RefreshErr:
  MsgBox Err.Description
End  Sub

Functions and events referenced

Full name Owners
Recordset.Requery Recordset

Referenced classes

Full name
adoPrimaryRS
grdDataGrid

Referenced properties

Full name Scope
DataGrid.DataSource attribute



cmdDelete

private sub cmdDelete_Click( )


General information

Full name cmdDelete.cmdDelete_Click
Access private
Overload of  

Source code

Private  Sub cmdDelete_Click()
   On Error GoTo DeleteErr
  With adoPrimaryRS
    . Delete
    .MoveNext
     If .EOF  Then .MoveLast
   End With
  Exit  Sub
DeleteErr:
  MsgBox Err.Description
End  Sub

Functions and events referenced

Full name Owners
Recordset.MoveLast Recordset
Recordset.MoveNext Recordset
Recordset.Delete Recordset

Referenced classes

Full name
adoPrimaryRS

Referenced properties

Full name Scope
Recordset.EOF attribute



cmdEdit

private sub cmdEdit_Click( )


General information

Full name cmdEdit.cmdEdit_Click
Access private
Overload of  

Source code

Private  Sub cmdEdit_Click()
   On Error GoTo EditErr
  lblStatus.Caption =  "Update the current row"
  mbEditFlag =  True
  SetButtons  False
  Exit  Sub
EditErr:
  MsgBox Err.Description
End  Sub

Functions and events referenced

Full name Owners
frmemployee.SetButtons frmemployee

Referenced classes

Full name
lblStatus

Referenced properties

Full name Scope
frmemployee.mbEditFlag attribute



cmdAdd

private sub cmdAdd_Click( )


General information

Full name cmdAdd.cmdAdd_Click
Access private
Overload of  

Source code

Private  Sub cmdAdd_Click()
   On Error GoTo AddErr
  adoPrimaryRS.MoveLast
  adoPrimaryRS.AddNew
  grdDataGrid.SetFocus
  Exit  Sub
AddErr:
  MsgBox Err.Description
End  Sub

Functions and events referenced

Full name Owners
Recordset.AddNew Recordset
Recordset.MoveLast Recordset

Referenced classes

Full name
grdDataGrid
adoPrimaryRS



cmdLast

private sub cmdLast_Click( )


General information

Full name cmdLast.cmdLast_Click
Access private
Overload of  

Source code

Private  Sub cmdLast_Click()
   On Error GoTo GoLastError
  adoPrimaryRS.MoveLast
  mbDataChanged =  False
  Exit  Sub
GoLastError:
  MsgBox Err.Description
End  Sub

Functions and events referenced

Full name Owners
Recordset.MoveLast Recordset

Functions/Events referencing

Full name Owners
frmemployee.Form_KeyDown frmemployee

Referenced classes

Full name
adoPrimaryRS

Referenced properties

Full name Scope
frmemployee.mbDataChanged attribute



cmdNext

private sub cmdNext_Click( )


General information

Full name cmdNext.cmdNext_Click
Access private
Overload of  

Source code

Private  Sub cmdNext_Click()
   On Error GoTo GoNextError
   If  Not adoPrimaryRS.EOF  Then adoPrimaryRS.MoveNext
   If adoPrimaryRS.EOF  And adoPrimaryRS.RecordCount >  0  Then
    Beep
    adoPrimaryRS.MoveLast
   End  If
  mbDataChanged =  False
  Exit  Sub
GoNextError:
  MsgBox Err.Description
End  Sub

Functions and events referenced

Full name Owners
Recordset.MoveLast Recordset
Recordset.MoveNext Recordset

Functions/Events referencing

Full name Owners
frmemployee.Form_KeyDown frmemployee

Referenced classes

Full name
adoPrimaryRS

Referenced properties

Full name Scope
frmemployee.mbDataChanged attribute
Recordset.RecordCount attribute
Recordset.EOF attribute



cmdPrevious

private sub cmdPrevious_Click( )


General information

Full name cmdPrevious.cmdPrevious_Click
Access private
Overload of  

Source code

Private  Sub cmdPrevious_Click()
   On Error GoTo GoPrevError
   If  Not adoPrimaryRS.BOF  Then adoPrimaryRS.MovePrevious
   If adoPrimaryRS.BOF  And adoPrimaryRS.RecordCount >  0  Then
    Beep
    adoPrimaryRS.MoveFirst
   End  If
  mbDataChanged =  False
  Exit  Sub
GoPrevError:
  MsgBox Err.Description
End  Sub

Functions and events referenced

Full name Owners
Recordset.MoveFirst Recordset
Recordset.MovePrevious Recordset

Functions/Events referencing

Full name Owners
frmemployee.Form_KeyDown frmemployee

Referenced classes

Full name
adoPrimaryRS

Referenced properties

Full name Scope
frmemployee.mbDataChanged attribute
Recordset.RecordCount attribute
Recordset.BOF attribute



cmdFirst

private sub cmdFirst_Click( )


General information

Full name cmdFirst.cmdFirst_Click
Access private
Overload of  

Source code

Private  Sub cmdFirst_Click()
   On Error GoTo GoFirstError
  adoPrimaryRS.MoveFirst
  mbDataChanged =  False
  Exit  Sub
GoFirstError:
  MsgBox Err.Description
End  Sub

Functions and events referenced

Full name Owners
Recordset.MoveFirst Recordset

Functions/Events referencing

Full name Owners
frmemployee.Form_KeyDown frmemployee

Referenced classes

Full name
adoPrimaryRS

Referenced properties

Full name Scope
frmemployee.mbDataChanged attribute



adoPrimaryRS

private sub adoPrimaryRS_MoveComplete( byval adReason as ADODB.EventReasonEnum , byval pError as ADODB.Error , adStatus as ADODB.EventStatusEnum , byval pRecordset as ADODB.Recordset )


General information

Full name adoPrimaryRS.adoPrimaryRS_MoveComplete
Access private
Overload of  

Parameters
pRecordset ADODB.Recordset
adStatus ADODB.EventStatusEnum
pError ADODB.Error
adReason ADODB.EventReasonEnum

Source code

Private  Sub adoPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
  lblStatus.Caption =  "Record: " & CStr(adoPrimaryRS.AbsolutePosition)
End  Sub

Referenced classes

Full name
adoPrimaryRS
lblStatus

Referenced properties

Full name Scope
Recordset.AbsolutePosition attribute



private sub adoPrimaryRS_WillChangeRecord( byval adReason as ADODB.EventReasonEnum , byval cRecords as Long , adStatus as ADODB.EventStatusEnum , byval pRecordset as ADODB.Recordset )


General information

Full name adoPrimaryRS.adoPrimaryRS_WillChangeRecord
Access private
Overload of  

Parameters
pRecordset ADODB.Recordset
adStatus ADODB.EventStatusEnum
cRecords Long
adReason ADODB.EventReasonEnum

Local variables

bCancel Boolean

Source code

Private  Sub adoPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal cRecords As  Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
   Dim bCancel As  Boolean
   Select  Case adReason
   Case adRsnAddNew
   Case adRsnClose
   Case adRsnDelete
   Case adRsnFirstChange
   Case adRsnMove
   Case adRsnRequery
   Case adRsnResynch
   Case adRsnUndoAddNew
   Case adRsnUndoDelete
   Case adRsnUndoUpdate
   Case adRsnUpdate
   End  Select
   If bCancel  Then adStatus = adStatusCancel
End  Sub

Referenced properties

Full name Scope
adoPrimaryRS.adoPrimaryRS_WillChangeRecord.adStatus parameter
adoPrimaryRS.adoPrimaryRS_WillChangeRecord.bCancel local
adoPrimaryRS.adoPrimaryRS_WillChangeRecord.adReason parameter




Document created on Wednesday 20 March 2002 at 09:57 by Visual Expert