Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Run-time error 6013 VBA - Access - List box

Posted on 2014-03-11
2
Medium Priority
?
882 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 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

916 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