Hi Martyn,
don't show NavigationButtons on the form properties and make
your own using command buttons
'------------------------------------ RecordDelete
Function RecordDelete()
'example useage: OnClick event
'of a Delete Record command button
' = RecordDelete()
On Error GoTo RecordDelete_error
DoCmd.RunCommand acCmdDeleteRecord
Screen.ActiveForm.Requery
Exit Function
RecordDelete_error:
MsgBox Err.Number & " " & Err.Description _
, , "Cannot delete record right now"
End Function
'------------------------------------ RecordFirst
Function RecordFirst()
'example useage: OnClick event
'of a Go To First Record command button
' = RecordFirst()
On Error GoTo RecordFirst_error
DoCmd.RunCommand acCmdRecordsGoToFirst
Exit Function
RecordFirst_error:
MsgBox Err.Number & " " & Err.Description _
, , "Cannot go to first record right now"
End Function
'------------------------------------ RecordPrev
Function RecordPrev()
'example useage: OnClick event
'of a Go To Previous Record command button
' = RecordPrev()
On Error GoTo RecordPrev_error
DoCmd.RunCommand acCmdRecordsGoToPrevious
Exit Function
RecordPrev_error:
MsgBox Err.Number & " " & Err.Description _
, , "Cannot go to previous record right now"
End Function
'------------------------------------ RecordNext
Function RecordNext()
'example useage: OnClick event
'of a Go To Next Record command button
' = RecordNext()
On Error GoTo RecordNext_error
DoCmd.RunCommand acCmdRecordsGoToNext
Exit Function
RecordNext_error:
MsgBox Err.Number & " " & Err.Description _
, , "Cannot go to next record right now"
End Function
'------------------------------------ RecordLast
Function RecordLast()
'example useage: OnClick event
'of a Go To Last Record command button
' = RecordLast()
On Error GoTo RecordLast_error
DoCmd.RunCommand acCmdRecordsGoToLast
Exit Function
RecordLast_error:
MsgBox Err.Number & " " & Err.Description _
, , "Cannot go to last record right now"
End Function
'------------------------------------ RecordNew
Function RecordNew()
'example useage: OnClick event
'of a New Record command button
' = RecordNew()
On Error GoTo RecordNew_error
'if there have been changes to the current record,
'save them
If Screen.ActiveForm.Dirty Then
Screen.ActiveForm.Dirty = False
end if
DoEvents
DoCmd.RunCommand acCmdRecordsGoToNew
Exit Function
RecordNew_error:
If Err.Number = 2046 Then
'You are already on a new record
Exit Function
End If
MsgBox Err.Number & " " & Err.Description _
, , "Cannot go to a new record right now"
End Function
Warm Regards,
Crystal
Microsoft Access MVP 2006
*
Have an awesome day
remote programming and training
strive4peace2006 at yahoo.com
*