• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

Access 2007 Question

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?

1 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

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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now