You are on page 1of 2

Nt u:

Private Sub Command0_Click() On Error GoTo Err_Command0_Click If f = False Then DoCmd.GoToRecord , , acFirst f = True Else MsgBox ("y l mu tin u tin") End If Exit_Command0_Click: Exit Sub Err_Command0_Click: MsgBox Err.Description Resume Exit_Command0_Click End Sub

Me.Bookmark = Me.Recordset.Bookmark End Sub

Nt Nhp:
Private Sub cmdAdd_Click() 'Add a new row to the recordset Me.Recordset.AddNew Me.Recordset("CompanyName") = "New C ompany" Me.Recordset.Update 'Move to the row that was added Me.Bookmark = Me.Recordset.Bookmark End Sub

Nt Tm:
Private Sub cmdFind_Click() Dim strClientID As String Dim varBookmark As Variant varBookmark = Me.Recordset.Bookmark strClientID = InputBox("Enter Client ID of Client You Want to Locate") Me.Recordset.Find "ClientID = " & st rClientID, Start:=1 If Me.Recordset.EOF Then MsgBox "Client ID " & strClientI D & " Not Found!!" Me.Recordset.Bookmark = varBookm ark Else Me.Bookmark = Me.Recordset.Bookm ark End If End Sub

Nt Xa:
Private Sub cmdDelete_Click() 'Ask user if he really wants to dele te the row intAnswer = MsgBox("Are You Sure???" , _ vbYesNo + vbQuestion, _ "Delete Current Record?") 'If he responds yes, delete the row and 'move to the next row If intAnswer = vbYes Then Me.Recordset.Delete Call cmdNext_Click Me.Refresh End If End Sub

Nt Hy:
Private Sub Form_BeforeUpdate(Cancel As Int eger) If MsgBox("Are you sure you want to s ave changes to this record?", _ vbYesNo Or vbInformation, "Confirm Upate") = vbNo Then DoCmd.CancelEvent End If End Sub

Nt Ti:
Private Sub cmdNext_Click() Me.Recordset.MoveNext If Me.Recordset.EOF Then Me.Recordset.MovePrevious MsgBox "Already at Last Record!! " End If Me.Bookmark = Me.Recordset.Bookmark End Sub

Form Filter:
Private Sub Form_Filter(Cancel As Integer, FilterType As Integer) Select Case FilterType Case acFilterByForm MsgBox "You Just Selected Fi lter By Form" Case acFilterAdvanced MsgBox "You Are Not Allowed to Select Advanced Filter/Sort" Cancel = True End Select End Sub

Nt Li:
Private Sub cmdPrevious_Click() Me.Recordset.MovePrevious If Me.Recordset.BOF Then Me.Recordset.MoveNext MsgBox "Already at First Record! !" End If

Trch hoten. ?right(a,len(a)-instrRev(a," "))

You might also like