Results 1 to 3 of 3
  1. #1
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169

    Getting run-time error '5' with resort command button

    Hello,

    Strange issue with my resort command button. This was working fine until I imported my client form into another database. Now Im getting an error on the first line. What gives?

    Private Sub SortSite_Click()


    If Me.SortSite.Caption = "Sort (Z-A)" Then

    DoCmd.GoToControl "Supported Site(s)"
    DoCmd.RunCommand acCmdSortAscending
    Me.SortSite.Caption = "Sort (Z-A)"

    Else

    DoCmd.GoToControl "Supported Site(s)"
    DoCmd.RunCommand acCmdSortDescending
    Me.SortSite.Caption = "Sort (A-Z)"

    End If

    End Sub

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    In the other database - can you re-create the button and it's On Click Event and make it work?
    I know that doesn't answer your question, but I'm curious - because I don't see a reason for the code not to work.

  3. #3
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    I have not tried that....I will let you know. Thanks.

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

Similar Threads

  1. Replies: 3
    Last Post: 06-09-2012, 08:14 AM
  2. Error Import Command Button
    By kowen091010 in forum Access
    Replies: 4
    Last Post: 12-15-2011, 07:56 AM
  3. Replies: 4
    Last Post: 07-22-2011, 12:52 PM
  4. Replies: 1
    Last Post: 07-27-2010, 02:27 PM
  5. Command button for time & date
    By joet5402 in forum Forms
    Replies: 2
    Last Post: 12-20-2007, 02:59 AM

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