The copy text and add new record Button Events are not working (1 Viewer)

access2010

Registered User.
Local time
Today, 01:40
Joined
Dec 26, 2009
Messages
1,139
An error message keeps occurring when trying to add a new record with the button event on the form or using the macro Ctrl + New..

A similar error occurs when trying to copy the stock name, using the “K” button event.

We would appreciate your assistance in solving these Access 2003 problems.

We have purchased a current Access license and will upgrade our Access 2003 databases once a few problems are corrected.

Your assistance is appreciated.

Barbara
 
would be nice of you to provide
1. the error message(s)
2. and the code /macro - even a screen dump, particularly for the "K" button
 
An error message keeps occurring when trying to add a new record with the button event on the form or using the macro Ctrl + New..

A similar error occurs when trying to copy the stock name, using the “K” button event.

We would appreciate your assistance in solving these Access 2003 problems.

We have purchased a current Access license and will upgrade our Access 2003 databases once a few problems are corrected.

Your assistance is appreciated.


Barbara
Hi Barbara
Are you able to upload a copy of your database so we can see if we get the same error's?
 
Have you compiled the database? Are there errors? You cannot convert it until these are fixed.

When did the code stop working? Did a MS update happen just before the code broke? Code that has been working doesn't simply break. When that happens it is generally one of two things.
1. The code never worked correctly but no data that "broke" it had previously been processed.
2. An update to Access or Windows caused the issue. A2003 has been out of maintenance for more than 15 years so MS isn't issuing updates although some security update may break it.
 
would be nice of you to provide
1. the error message(s)
2. and the code /macro - even a screen dump, particularly for the "K" button
would be nice of you to provide
1. the error message(s)
2. and the code /macro - even a screen dump, particularly for the "K" button
GaP42

Thank you for your note. I am new to this and thought that our database had been uploaded.

Please find the problem database attached.
Barbara.
 

Attachments

Please find the problem database attached.
Barbara.

The file attached to your post is a .pdf file with the error messages you've received. These don't tell us a lot I'm afraid. What we really need is a copy of your .accdb file, with any personal or otherwise sensitive data removed or disguised. We'd then be able to debug the file.
 
The file attached to your post is a .pdf file with the error messages you've received. These don't tell us a lot I'm afraid. What we really need is a copy of your .accdb file, with any personal or otherwise sensitive data removed or disguised. We'd then be able to debug the file.
 
Ken, please find the code and database with which I am having a problem..

= = =
I would appreciate some help with the adding of new records to this form



@On Click = Event Procedure
= = =
Private Sub cmdAddNewRecord_Click()

On Error GoTo Err_cmdAddNewRecord_Click



' Save any current changes to the record

DoCmd.RunCommand acCmdSaveRecord



' Attempt to add a new record

DoCmd.GoToRecord , , acNewRec



Exit_cmdAddNewRecord_Click:

Exit Sub



Err_cmdAddNewRecord_Click:

MsgBox "Error " & Err.Number & ": " & Err.Description

Resume Exit_cmdAddNewRecord_Click

End Sub

= = =
Error Message
Stock Name and Stock Symbol already exists on the investments01_Tbl => OK

= = =
You can’t go to the specified record

Thank you Barbara
 
Ken, please find the code and database with which I am having a problem..

= = =
I would appreciate some help with the adding of new records to this form

The error you are experiencing suggests that something in the current record is violating a unique index. This could be duplication of the primary key value(s), or of value(s) in another uniquely indexed column or columns. This prevents the record being saved, which in turn prevents the form from being moved to an empty new record.

If you are unable to identify the cause of the error would it be possible for you to post a copy of your file here, stripped of any personal or otherwise sensitive data? If so, provide details of the exact changes you are attempting to make to the current record when the error occurs.
 
The error you are experiencing suggests that something in the current record is violating a unique index. This could be duplication of the primary key value(s), or of value(s) in another uniquely indexed column or columns. This prevents the record being saved, which in turn prevents the form from being moved to an empty new record.

If you are unable to identify the cause of the error would it be possible for you to post a copy of your file here, stripped of any personal or otherwise sensitive data? If so, provide details of the exact changes you are attempting to make to the current record when the error occurs.
Thank you for your note, Ken.



The database is attached.

We have been using this code since 2010 without any issue until now in THIS FORM
 
No attached access db. Your pdf in post 5 showed 3 error messages ...
you might indicate how these errors are generated in the access db you provide. which form , which action?
 
The database is attached.

No file was attached to your last post.

Looking back at the error messages you received, the wording is not what I'd expect if the key or another unique index is being violated, so I'm wondering if you have some a custom error handling procedure. Try posting the file again.
 
Have you compiled the database? Are there errors? You cannot convert it until these are fixed.

When did the code stop working? Did a MS update happen just before the code broke? Code that has been working doesn't simply break. When that happens it is generally one of two things.
1. The code never worked correctly but no data that "broke" it had previously been processed.
2. An update to Access or Windows caused the issue. A2003 has been out of maintenance for more than 15 years so MS isn't issuing updates although some security update may break it.
Thank you Pat for your comments.
We have been using this code in many different forms and databases since before 2010 iwith no problems.
The ONLY problem we have with the code is with this form.
Once we have resolved all of our little problems we will be upgrading our Access 2003 databases to the current version.
We compile all of our databases weekly.
This is the ONLY FORM we have been having a problem with for at least a few years, and want to fix the problem before upgrading our databases..
Barbara
 
Thank you Pat for your comments.
We have been using this code in many different forms and databases since before 2010 iwith no problems.
The ONLY problem we have with the code is with this form.
Once we have resolved all of our little problems we will be upgrading our Access 2003 databases to the current version.
We compile all of our databases weekly.
This is the ONLY FORM we have been having a problem with for at least a few years, and want to fix the problem before upgrading our databases..
Barbara
Hi Barbara
Can you upload the Db so we can see the problem?
 
No file was attached to your last post.

Looking back at the error messages you received, the wording is not what I'd expect if the key or another unique index is being violated, so I'm wondering if you have some a custom error handling procedure. Try posting the file again.
Thank you for your patience, Ken
The database should be attached again.

We have been using this code since 2010 without any issues, but ONLY in THIS FORM not working properly.. We are trying to ensure there are no errors in this database before upgrading to a current Version.

Barbara
 
Thank you for your patience, Ken
The database should be attached again.

We have been using this code since 2010 without any issues, but ONLY in THIS FORM not working properly.. We are trying to ensure there are no errors in this database before upgrading to a current Version.

Barbara
Hi Barbara
No attachment
 
Hello Mike, I hope the database is now uploaded
No it is not.

The process is that you click the Reply button and enter your answer.
Then click the "Attach Files" button and navigate to the database file you want to upload.
Make sure that you compress the file into a zipped format.
Then select the compressed/zipped file and click Open.
The file will then be attached to your message for upload to the Forum.
 
Barbara, I asked TWO questions and I numbered them to bring that to your attention so you would answer the two questions specifically. I know you are not technical but you didn't answer either. Maybe you thought they were meaningless but I've been doing this for a long time and with debugging, you start with the simple stupid stuff and work to the more exotic. It is reallllllly hard to help you when you don't answer specific questions.
 

Users who are viewing this thread

Back
Top Bottom