J
Jim
Greetings,
Several forms in my Access application have form
navigation buttons, i.e. "First Record", "Next Record",
etc. The class modules in each of these forms have the
following code to enable/disable the buttons based on the
current record:
With Me.RecordsetClone
..MoveLast
cmdNextRecord.Enabled = Me.CurrentRecord < .RecordCount
cmdPreviousRecord.Enabled = Me.CurrentRecord > 1
cmdFirstRecord.Enabled = Me.CurrentRecord > 1
cmdLastRecord.Enabled = Me.CurrentRecord < .RecordCount
End With
cmdNewRecord.Enabled = Not Me.NewRecord
cmdDeleteRecord.Enabled = Not Me.NewRecord
Since the identical code appears in multiple forms, I
thought it would be more convenient to create a standard
module and call for it from the form class modules. Since
the "Me" object cannot be used in the standard module, is
there another way to do it?
Any help will be greatly appreciated.
jn
Several forms in my Access application have form
navigation buttons, i.e. "First Record", "Next Record",
etc. The class modules in each of these forms have the
following code to enable/disable the buttons based on the
current record:
With Me.RecordsetClone
..MoveLast
cmdNextRecord.Enabled = Me.CurrentRecord < .RecordCount
cmdPreviousRecord.Enabled = Me.CurrentRecord > 1
cmdFirstRecord.Enabled = Me.CurrentRecord > 1
cmdLastRecord.Enabled = Me.CurrentRecord < .RecordCount
End With
cmdNewRecord.Enabled = Not Me.NewRecord
cmdDeleteRecord.Enabled = Not Me.NewRecord
Since the identical code appears in multiple forms, I
thought it would be more convenient to create a standard
module and call for it from the form class modules. Since
the "Me" object cannot be used in the standard module, is
there another way to do it?
Any help will be greatly appreciated.
jn