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

access2010

Registered User.
Local time
Yesterday, 22:26
Joined
Dec 26, 2009
Messages
1,131
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?
 

Users who are viewing this thread

Back
Top Bottom