• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • 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.

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

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