Hi,
I for the life of me cannot figure this out! Code Below! When I open my form, the first and previous record should be enabled = false. However, this doesn't happen with the code I am using and I dont know why. I beleive it is something not seeing the first record maybe? I dont know. It works fine if you go to next or last first,, works just fine. Just not on open. Maybe I have not called out something on this I need to? I would really like to solve this issue.
Thanks
Dave
Code:
Public Function GotoCurrent()
On Error Resume Next
If Screen.ActiveForm.CurrentRecord = 1 Then
Screen.ActiveForm.CmdPrevious.Enabled = False
Screen.ActiveForm.CmdFirst.Enabled = False
Else
Screen.ActiveForm.CmdPrevious.Enabled = True
Screen.ActiveForm.CmdFirst.Enabled = True
End If
If Screen.ActiveForm.CurrentRecord = Screen.ActiveForm.Recordset.RecordCount Then
Screen.ActiveForm.CmdLast.Enabled = False
Else
Screen.ActiveForm.CmdLast.Enabled = True
End If
If Screen.ActiveForm.CurrentRecord >= Screen.ActiveForm.Recordset.RecordCount Then
Screen.ActiveForm.CmdNext.Enabled = False
Else
Screen.ActiveForm.CmdNext.Enabled = True
End If
End Function