Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Run-time error 6013 VBA - Access - List box

Posted on 2014-03-11
2
Medium Priority
?
862 Views
Last Modified: 2014-03-13
Hi experts
Getting an error "Run-time error 6013" Unable to remove item - When I am clicking on a wrong button in my form to move items in between two list boxes.
I am using the method as in http://support.microsoft.com/kb/278378. Its working fine but not able to handle the error messages. Some times blank items coming in - when clicking on wrong button - getting error messages - etc. Please kindly help.
0
Comment
Question by:gtmathewDallas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
GrahamMandeno earned 2000 total points
ID: 39922788
It seems that you just need some error handling.  In each of the MoveXXXXItems procedures, add the following code:

At the beginning:
   On Error GoTo ProcErr

At the end, just before End Sub:
ProcExit:
    Exit Sub
ProcErr:
    Select Case Err.Number
        Case 6013
            MsgBox "Nothing to move"
        Case Else
            MsgBox "Error #" & Err.Number & vbCrLf & Err.Description
    End Select
    Resume ProcExit

Open in new window

Then error 6013 will give a meaningful error, and any other error will give a message but continue without stopping the code.

Best wishes,
Graham Mandeno [Access MVP 1996-2014]
0
 

Author Closing Comment

by:gtmathewDallas
ID: 39927405
Thank you so much GrahamMandeno, It is good one..Thanks again..
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question