G
grubbyr
hi...
I hope someone can help me with this..
I am a newbie so please forgive my ignorance
I am setting up a customer dbase in access 2007
and with help from previous questions and answers on the forum I was
able to set up [First] [Next] [Previous] [Last] record cmd buttons as
below:
The code worked really well...
I shut access down and next day opened it up and now none of my code
works at all...
I cant seem to get it to trigger...
I seemed to have this problem the other day so I did a repair install
of office 2007
and then started from scratch and it worked fine until I shutdown then
rebooted...
Its driving me crazy... please help!
Option Compare Database
Private Sub Form_Current()
' check which record we are on, and enable buttons accordingly
If Me.CurrentRecord = 1 Then
' On the first record, don't need move first or move previous
Me.cmdFirst.Enabled = False
Me.cmdPrevious.Enabled = False
Else
' Not on the first record, do need move first and move
previous
Me.cmdFirst.Enabled = True
Me.cmdPrevious.Enabled = True
End If
Me.Company.SetFocus
' Check if we are on the last record, or a new record...
' if so, disable the next and last buttons
If Me.CurrentRecord >= Me.Recordset.RecordCount Then
' Last record
Me.cmdNext.Enabled = False
Me.cmdLast.Enabled = False
Else
' Not on last record
Me.cmdNext.Enabled = True
Me.cmdLast.Enabled = True
End If
Me.Company.SetFocus
End Sub
I hope someone can help me with this..
I am a newbie so please forgive my ignorance
I am setting up a customer dbase in access 2007
and with help from previous questions and answers on the forum I was
able to set up [First] [Next] [Previous] [Last] record cmd buttons as
below:
The code worked really well...
I shut access down and next day opened it up and now none of my code
works at all...
I cant seem to get it to trigger...
I seemed to have this problem the other day so I did a repair install
of office 2007
and then started from scratch and it worked fine until I shutdown then
rebooted...
Its driving me crazy... please help!
Option Compare Database
Private Sub Form_Current()
' check which record we are on, and enable buttons accordingly
If Me.CurrentRecord = 1 Then
' On the first record, don't need move first or move previous
Me.cmdFirst.Enabled = False
Me.cmdPrevious.Enabled = False
Else
' Not on the first record, do need move first and move
previous
Me.cmdFirst.Enabled = True
Me.cmdPrevious.Enabled = True
End If
Me.Company.SetFocus
' Check if we are on the last record, or a new record...
' if so, disable the next and last buttons
If Me.CurrentRecord >= Me.Recordset.RecordCount Then
' Last record
Me.cmdNext.Enabled = False
Me.cmdLast.Enabled = False
Else
' Not on last record
Me.cmdNext.Enabled = True
Me.cmdLast.Enabled = True
End If
Me.Company.SetFocus
End Sub