Relocate Navigation buttons in main form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main form and a subform
Im ok with having the record selection buttons at the bottom of the subform
but they get close to the navigation buttons at the bottom of the main form.
I dont want to lose screen space so idealy I want to position the navigation
buttons where I want - towards the top of the main form page. Any ideas?
 
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

*
 
Create your own command buttons with the wizard for navigation. Or create
your own menu bar with the navigation buttons on that.

Peter
 
Thank you to you all- I will try it and get back to you.
I was afraid this may be the solution, I did a similar solution a couple of
years back. Trouble is it never looks as visualy neat? Oh why can MS give me
the ability just to drag and drop this Navigation button object, it must be a
common issue!!!!
 
Back
Top