Results 1 to 2 of 2
  1. #1
    d9pierce1 is offline Expert
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776

    Public Function problem on form open

    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

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-05-2018, 04:00 PM
  2. public function values from form
    By ShostyFan in forum Programming
    Replies: 4
    Last Post: 10-02-2017, 02:11 PM
  3. Replies: 2
    Last Post: 09-12-2016, 11:00 AM
  4. Replies: 3
    Last Post: 06-24-2015, 06:25 PM
  5. Replies: 4
    Last Post: 11-13-2014, 08:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums