Solved

Run-time error 6013 VBA - Access - List box

Posted on 2014-03-11
2
823 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
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…

830 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