Solved

Run-time error 6013 VBA - Access - List box

Posted on 2014-03-11
2
792 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
2 Comments
 
LVL 20

Accepted Solution

by:
GrahamMandeno earned 500 total points
Comment Utility
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
Comment Utility
Thank you so much GrahamMandeno, It is good one..Thanks again..
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now