Access 2007 Question

Posted on 2012-09-18
Last Modified: 2012-09-20
Hi Everyone,

I have a Parameter Box coming up asking the user to enter the last four of SSN.  The user enters the last four and goes in, but there is a cancel button also.  If the user selects this they get an error.  I need the user to be taken back to the main menu when this happens or just load the parameter box again when cancel is selected.

What VBA coding to do this is needed and where do I place the coding?

Question by:jjc9809
    LVL 13

    Accepted Solution

    Catch error 2501 and handle it specifically.

    If Err.Number = 2501 Then
        'Custom code here
        'Normal error handling code here
    End If

    Open in new window

    LVL 9

    Expert Comment

    Rather than relying on the parameter prompt to come up, you could change your custom form so that instead of the big button, it has a text field that prompts for the employee's SSN. If you unsure how to do this, post your DB and we will show you.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    754 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

    24 Experts available now in Live!

    Get 1:1 Help Now