?
Solved

Customizing Menu Items in MS Access 2003

Posted on 2008-10-18
6
Medium Priority
?
305 Views
Last Modified: 2013-11-27
I have created a Find Records control on a Form. When the user enters a value that is not in the database, the message "Microsoft Access has finished searching the records....."  When I create the control on a different form, I get no message at all.  

How doI edit either form, so that a dialogue box pops up, along with the message, "Item not in database, Choose one of the following options:" (e.g. Add a new person, new organization, etc.)  I have all the code for adding records to the database, I just need to get from the initial error message to the dialogue box.

Thanks

Thanks

0
Comment
Question by:jlnero
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 22749357
If you have a trappable error, then the attached tutorial will give you a step by step on how to trap the error and substitute your own custom error message.

                http://www.databasedev.co.uk/custom-error-message.html
0
 
LVL 1

Accepted Solution

by:
PIER117 earned 750 total points
ID: 22749408
Build a form that can be used as a pop up if no record is found.  The form should have your options to add a record and your message.

On both forms you'll need some code in your right after your search that is something along the lines of:

SQL = "SELECT blah blah...where blah blah equals my form field"
Set rsSearch = db.OpenRecordset(SQL)
If rsSearch.EOF then
    'open the form that handles adding records and displays your error message
    DoCmd.OpenForm "AddNewblahblah"
End if

Open in new window

0
 

Author Comment

by:jlnero
ID: 22749565
Thanks for the quick responses... both look helpful,, I'll give them a try. Probabably won't report back until late tomorrowl
0
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

 

Author Comment

by:jlnero
ID: 22754736
The procedure defined at
                http://www.databasedev.co.uk/custom-error-message.html
begins by displaying the error number using the following code:

Private Sub Form_Error(DataErr As Integer, Response As Integer)
    Debug.Print "DataErr = "; DataErr
End Sub

Where would I put the code in the attached snippet?
Private Sub Command1150_Click()
On Error GoTo Err_Command1150_Click
 
    Screen.PreviousControl.SetFocus
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
 
Exit_Command1150_Click:
    Exit Sub
 
Err_Command1150_Click:
    MsgBox Err.Description
    Resume Exit_Command1150_Click

Open in new window

0
 
LVL 38

Assisted Solution

by:puppydogbuddy
puppydogbuddy earned 750 total points
ID: 22755045
If you are referring to the Error Proc with the debug.print code line, it would go in the form's error event code, so that you can get the error number  of the error you want to supress.  That way you will be able to find out what error number to trap in the error handler of the procedure that generates that error.

In regards to your snippet, please provide more details....what are you trying to accomplish with the code in your snippet .....and what is your request to us regarding that snippet?
0
 

Author Comment

by:jlnero
ID: 22758195
Ok -- that clarifies it... ignore the snippet for now.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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…
Suggested Courses

765 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