1
Private Sub cmdPrevious_Click() With AdoPatients.Recordset .MovePrevious If .BOF Then .MoveFirst MsgBox ("This is the first record of the file"), vbCritical End If End With End Sub Private Sub cmdPrevRec_Click() 'move to previous record AdoPatients.Recordset.MovePrevious If AdoPatients.Recordset.BOF = True Then 'message box to indicate past the beginning of file MsgBox "First Record", vbOKOnly, "Front!" 'need to reposition cursor to first record AdoPatients.Recordset.MoveFirst 'display records in textboxes End If End Sub

VB6.0 Code for Viewing Previous Record

Embed Size (px)

DESCRIPTION

vb programming

Citation preview

Private Sub cmdPrevious_Click()With AdoPatients.Recordset .MovePrevious If .BOF Then .MoveFirst MsgBox ("This is the first record of the file"), vbCritical End IfEnd WithEnd Sub

Private Sub cmdPrevRec_Click()'move to previous recordAdoPatients.Recordset.MovePreviousIf AdoPatients.Recordset.BOF = True Then'message box to indicate past the beginning of fileMsgBox "First Record", vbOKOnly, "Front!"'need to reposition cursor to first recordAdoPatients.Recordset.MoveFirst'display records in textboxesEnd IfEnd Sub