Error Making Duplicate Record

Apr 9, 2014

I am having an issue with one person having trouble getting an error when trying to duplicate a record.

The subform is set up with a button to duplicate a record. This allows most of the data that stays the same to be copied to a new records and then minor changes can be made to update the record for the new month. Since there are memo fields, in these records, this saves a lot of retyping. One person who is using the database gets the following error when clicking on the duplicate record button.

The command or action 'Copy' isn't available now.

It makes a new blank record but won't copy over the information. You can go to the record and copy each field individually and paste it into the new record, but this is not very practical.

I have not been able to duplicate the error and no one else using the database is having this happen.

View Replies


ADVERTISEMENT

Making Specific Fields In A Current Record Copy Themselves When Making New Record

Mar 28, 2005

;) Hey everybody,

I am working on a database used in recording device characteristics/test information. The main table of information has dozens of columns for test/part detailed information. When inputing the data for each specific test, many of the info. details are repeated when testing say 20 devices of the same part all at once. Rather than retype every piece of detailed information in every field, everytime, is there an easier way? Does anyone know of a way to make specific fields copy/paste the previous record's information in the fields automatically when a new record is created? Please, if anyone could help or has ANY ideas, let me know...

Thanks

gunwax

View 9 Replies View Related

Duplicate Record Error

Dec 21, 2006

I'm trying to make a simple DB that we can enter our time for working on projects.

So far I have a Form with the employees name and the date in it. Then below that is a subform with the project number, name, client name, and hours.

I want to use this whole "sheet" for one days worth of work for 1 employee. New sheets will be used for each day.

When I try to make a new sheet I get an error that it cant change the table because it would be creating a duplicate entry.

How do I solve this?

Also, should it be difficult to be doing what I'm trying to do?

View 2 Replies View Related

Duplicate Record Error

Aug 17, 2005

hi everyone,

i have a form that i'm trying to create a button to duplicate the record. i'm using the control wizard which produces the following code:

Private Sub DuplicateRecord_Click()
On Error GoTo Err_DuplicateRecord_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70

Exit_DuplicateRecord_Click:
Exit Sub

Err_DuplicateRecord_Click:
MsgBox Err.Description
Resume Exit_DuplicateRecord_Click

End Sub

When i try to execute the code via a comand button, i get an error and the duplicate record operation does not occur. one thing i noticed is that i have a lot of lookup fields (i.e. FK's to lookup tables one-to-many relationships) in underlying table being populated by the form. i've created combo boxes on the form to populate the FK's in the underlying table. the error that occurs when trying to use the above code produces a "paste errors" table and in that paste errors table instead of the bound column values from the combo boxes (i.e. PK values from the lookup tables) it shows the display values from the combo boxes. i'm not sure if this has do with anything, but i couldn't figure out why it was doing this.

does anyone have any ideas how i could get this duplicate record procedure to work?

many thanks for any help or suggestions.

View 1 Replies View Related

Duplicate Data Error While Saving An Edited Record

Jan 8, 2005

Having a problem when saving a record that has been edited and contains a duplicate field. Here is what I'm doing.

I have an existing record that is being viewed by the user. I have an edit button on the form that is displaying the record. When the user clicks the edit button I do the following

'User clicked on edit customer record

Private Sub CustEditRec_Click()

'Store current customer key in string so we can cross

'check if user has changed the key during edit

EditCustKey = Me.txtCustomerKey

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

'Set customer record test string so we can determine

'what the user is doing

CustomerRecStat = "edit"

' Go unlock the customer data fields for editing

UnlockCustomerFields

TxtCompanyName.SetFocus

'Go Unlock the customer editing buttons

UnLockCustomerAddButtons

'Lock the add, delete, edit buttons

CustAddRec.Enabled = False

CustEditRec.Enabled = False

CustDelRec.Enabled = False

'Go Disable the customer navagation buttons

DisableCustomerNavigation

txtCustomerKey.Visible = True

txtCustomerKey.Locked = False

txtCustomerKey.Enabled = True

'Set focus on the customer key

txtCustomerKey.SetFocus

'disable & hide the customer key combobox

cmboCustomerKey.Locked = True

cmboCustomerKey.Enabled = False

cmboCustomerKey.Visible = False

Exit_CustEditRec_Click:

Exit Sub

Err_CustEditRec_Click:

MsgBox Err.Description

Resume Exit_CustEditRec_Click

End Sub

The field which duplicate entries are not allowed in the table is txtCustomerKey. Now remember we are just editing a record NOT ADDING A NEW ONE.

When the user finished making the changes to the record we use the same procedure to save the changes as we when the user is adding a new record...here it is.

'User clicked save customer record

Private Sub CustSaveRec_Click()

On Error GoTo Err_CustSaveRec_Click

SaveCustomerRecord:

'Update the table data fields with the data contained on the form

CustomerKey = Me.txtCustomerKey

CustomerCompany = Me.TxtCompanyName

CustomerFirst = Me.txtCustomerFirst

CustomerLast = Me.txtCustomerLast

CustomerAddress = Me.txtCustomerAddress

CustomerCity = Me.txtCustomerCity

CustomerProvince = Me.txtCustomerProvince

CustomerPostal = Me.txtCustomerPostal

CustomerCountry = Me.txtCustomerCountry

CustomerPhone = Me.txtCustomerPhone

CustomerFax = Me.txtCustomerFax

CustomerEmail = Me.txtCustomerEmail

CustomerWeb = Me.txtCustomerWeb

CustomerNotes = Me.txtCustomerNotes

'Save the record

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

'*** IF WE GOT THIS FAR WITH OUT ERRORS WE SAVED THE RECORD

'*** GO AHEAD & DISABLE THE FORMS VARIOUS FIELDS

'*** & BUTTONS ONCE AGAIN AS WE ARE JUST BACK TO VIEWING

'*** THE CUSTOMERS DATABASE

'Enable and unlock the customer key field

txtCustomerKey.Visible = True

txtCustomerKey.Locked = False

txtCustomerKey.Enabled = True

'Hide & disable the customer keycombo box

cmboCustomerKey.Locked = True

cmboCustomerKey.Enabled = False

cmboCustomerKey.Visible = False

'Set focus on the customer key field

txtCustomerKey.SetFocus

'Lock the customer fields

LockCustomerFields

'Enable the navigation buttons

EnableCustomerNavigation

'Lock the customer adding buttons

LockCustomerAddButtons

'Clear the record testing status

CustomerRecStat = ""

txtCustomerKey_AfterUpdate

Exit_CustSaveRec_Click:

Exit Sub

Err_CustSaveRec_Click:

'If the error generated was by a duplicate value.

'This can only be caused by the customer key as this

'is the only field which does not allow duplicate values.

'so warn the user of this duplicate value error and set

'the focus on the customer key field

If Err.Number = 3022 Then

'if user is editing a record

If CustomerRecStat = "edit" Then

'And the entered customer key has not changed

If Me.txtCustomerKey = EditCustKey Then

'Return to saving the record as the key is

'not really a duplicate

GoTo SaveCustomerRecord

End If

End If



Select Case MsgBox("This Customer ID was already located in the database. Click OK to enter a new Customer ID or Cancel to stop adding this record?", vbExclamation + vbOKCancel + vbDefaultButton1, "Duplicate Customer ID")

Case vbOK

Me.txtCustomerKey.SetFocus

Resume Exit_CustSaveRec_Click

Case vbCancel

'Go simulate undo record click

CustUndoRec_Click

Resume Exit_CustSaveRec_Click

End Select

End If

MsgBox Err.Description

Resume Exit_CustSaveRec_Click

End Sub



The problem is when the user is editing a record. The database assumes the txtCustomerKey is a duplicate in the table. However we are not adding a new record so the duplicate error is false. Its just that the txtCustomerKey is the same as the record being edited. Its not DUPLICATED its the SAME.....



Any help anyone? Sorry for the long post but I'm a strong believer in the more information the better when trying to solve a problem....

Thx

Kao

View 1 Replies View Related

Modules & VBA :: Error Message On Creating Duplicate Record

Jul 25, 2013

I need to be able to produce an error on a form where the user attempts to create a new user that already exists. The error needs to be produced when the save button is clicked.

See below for the existing code on my save button which exists in form, 'frmAddEditUser':

Private Sub cmdSave_Click()
If IsNull(cboManagerID) = True Then
MsgBox "Please select a manager", vbExclamation, "Details Missing!"
Me.cboManagerID.Requery

[Code] ....

Currently, if I attempt to create a user with the same Payroll ID as an existing user, my 'User details saved' message box is displayed and to the user it looks like a new record has saved successfully which isn't the case.

I need a message box to appear displaying something like "Payroll ID n already exists" where n is the 'PayrollID' of the duplicate record. (Is it possible to combine a value from a certain control and ones own custom text?)

Note: PayrollID is a combination of letters and numbers, i.e. two letters, followed by 5 numbers, e.g. JD12345.

For reference, the table/field and and control are called, '[tblUser].[PayrollID]' and 'txtPayrollID' (on 'frmAddEditUser') respectively; it is from this field and control that I want the error to be produced if the user is entering the same values which are existing in 'tblUser'.

View 10 Replies View Related

Forms :: Error On 2nd Combo When Adding A Duplicate Record?

Jun 7, 2015

error message I am getting when I click on my Duplicate Record button (created through the wizard).

I have two combo boxes on the main form that populates data when the user makes a selection from the combo box. First combo box populates project data and the second combo box populates equipment data. The form is working well with the two combo boxes populating the data into the main table.

Now I would like to add a duplicate record button to copy a record and paste the data as a new record. So, I added a duplicate record button using the wizard and I am receiving the following AfterUpdate error.

Run-time error 3020: Update or CancelUpdate without AddNew or Edit.

This is the code I am using to copy and paste a duplicate record:

Private Sub InputForm_DupRec_Button_Click()
On Error GoTo Err_InputForm_DupRec_Click
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPasteAppend
Exit_InputForm_DupRec_Click:
Exit Sub
Err_InputForm_DupRec_Click:
MsgBox Err.Description
Resume Exit_InputForm_DupRec_Click

It seems to be duplicating the data from the first combo box, but not the second one where it errors out.

View 1 Replies View Related

Error In Making MDe

Nov 15, 2007

Hi guys,

I am having error message when I tried to make my mdb file to mde. The error message is "MS Access unable to create an MDE database". Reading through the help message it says that this problem always occurrs in trying to compile large db into MDE. So what can I do to solve this problem. Also what is MS access memory capacity. thanks

View 6 Replies View Related

Making Custom Error Messages?

Aug 24, 2004

Can it be done?

Thanks

View 1 Replies View Related

Forms :: Making Directory - Runtime Error 13

May 25, 2014

I'm getting a runtime error 13 on this line of code. Its a piece of code to make a directory, but I cant see anything wrong!

Code:
strBackUpDogNameFolder = "c:GPandDetectionDogTrainingLogBackUpsandReports" & Forms![frm_Profile]![Discipline] " & Forms![frm_Profile]![DogName]"

View 8 Replies View Related

General :: Making Use Of Import Error Tables

Mar 27, 2013

I am attempting to set up a saved import procedure in an Access database that will be run programmatically using docmd.RunSavedImportExport. The source document is an Excel file.My goal is to trap any import errors caused by inconsistencies in the source data. I'd also like to provide the user with some small amount of feedback on what is causing these errors.

My initial thought was to make use of the "File_ImportErrors" table that is generated following an unsuccessful import. *Not once* has this import procedure consistently generated an error table - sometimes the table is created, sometimes it isn't.

I have tried changing the file format of the import file to comma- and tab-delimited files, respectively. Both of these formats do consistently generate an error table, however none of the error values in the table are accurate - it reports a slew of type conversion errors for fields that are completely consistent and unproblematic, whilst completely overlooking conspicuous errors from text strings in date fields.

I have tried the same import, both procedurally and manually, using all available Excel and text-delimited formats, with the same respective results.I notice that nearly every thread on AWF pertaining to error tables discusses how to delete them, rather than make effective use of them. I suspect this is perhaps why?

View 1 Replies View Related

Making Cursor Go Back To The Record I Came From?

Dec 27, 2006

I have a subform (continuous) which shows a summary of all clients basic data in a list. Clicking a client requerys and refreshes some other subforms so the accompanying data for that client is shown. Whenever I double click a record, the "main" window for that "object" opens. So say I double click on client A1 in the summary list, a form opens where I can view all the clients data and change it if necessary. That same form is also used to add clients to the database.

Whenever I change or add a clients data and close the form, the following code is executed:

Private Sub Form_Close()
On Error GoTo ClientsAdd_Err

Forms![ClientsMain]![ClientsViewSummarySubForm].Form.Requery
Forms!ClientsMain.Refresh

ClientsAdd_Exit:
Exit Sub

ClientsAdd_Err:
MsgBox Error$
Resume ClientsAdd_Exit
End Sub

Which makes the new client appear in the summary list or makes the changed data of an existing client appear in the summary list. That's what I want it to do of course.

But whenever that is done, the cursor jumps back to the first record (client 1) in the summary list. What I would like to have happen is:

- when a new client has been added, keep the cursor on that client in the summary list after the form closes and the list is updated.

- when a record of an already existing client is changed and the form closes, keep the cursor on that client in the list also.

DoCmd.GoToRecord acForm, "ClientsViewSummarySubForm", acLastgives "The object ClientsViewSummarySubForm isn't open. As does the same line of code but then using the name "ClientsViewSummary". The form itself is called that way. The subform object itself goes by: "ClientsViewSummarySubForm".

I've tried some variations but all without succes.
Which line of code is the correct one to use for a subform on a parentform instead of "just" a normal, open form?

View 2 Replies View Related

Making Last Record Appear In Macro Button

Apr 14, 2014

I have created a button with Macro located on form in record. It does what I want except I want it to display only last record. Currently it is displays first record and I have to scroll. See attached photo of what I have. Access 2010

View 2 Replies View Related

Duplicate Key Error !!!!!

Jun 14, 2005

Hi there

I have the following field in my access project.

Sno
Name
PortNo
Location
Speed
Package

In the above field i had set Sno is PRIMARY KEY. The problem is after entering all field, then only it will show the duplicate Sno error. What I want is, if Sno is duplicate, when i type SNo , successively i have to get the SNo is duplicate.

Help me to solve this issue

thanx in advance

by
yasi

View 2 Replies View Related

Making A MsgBox Appear After A Blank Record Is Shown?

Mar 10, 2005

hi,
i have a form, which when opened, gives me a blank record. which is what i asked it to do in the OnOpen property. however, i also need a msg box to popup - but after the form has been opened. i tried placing both pieces of 'code' into the OnOpen property, however, the popup displays first, then the form opens.

so currently i have:

Private Sub Form_Load()
Select Case MsgBox("Please select the Registration Number from the drop down menu or type it in", vbOKOnly, "Select Registration Number")

End Select
End Sub
--------------------------------------------------------------------------
Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec

End Sub
--------------------------------------------------------------------------

but it does the same thing. so, is there a way to make the msg box appear after the form opens with a blank record?
thank you in advance :D

View 3 Replies View Related

Problems Making A Field In A Record With A Unique Value

Oct 23, 2004

Hi I have a very simple table, with say 5 fields (all text). There is only 1 table. The first field is name, and I want to enforce its uniqness across all other table.name values. I am completely new to Access database and am not sure how to do this.
Any help would be greatly appreciated.

Thanks, Edin

View 3 Replies View Related

Duplicate Error Message Help

Jul 6, 2005

hi,

the below scrip was taken from another forum member.

i have put this in the Forms / error VBA

but i still a little lost

i have set 3 fields to be indexed not to allow duplicate information (Forename, Surename, DOB)

i was then advised to error trap so it would highlight that i have enterd a duplicate record on typing in the DOB (As that as third feild to be entered)

so i then used the below script, however this doesnt highlight that it is a duplicate it just doesnt let me go on to the next record, the only time the error message is highlighted is when i go into design mode.

anyideas on where to go from here.


Private Sub Form_Error(DataErr As Integer, Response As Integer)
If DataErr = 3022 Then
Response = acDataErrContinue
MsgBox "Tis MerID alredy exist!"
Exit Sub
End If
If DataErr = 2169 Then
Response = acDataErrContinue
MsgBox "Tis record will not be saved!"
Exit Sub
End If

End Sub

View 3 Replies View Related

Finding Sequence Of Fields Making A Unique Record

Aug 23, 2006

I have a MS Access 2000 database with 136 data tables in it. What I would like to do is execute a piece of VBA code which will list for me in another table, (for example: Field1: TABLE NAME Field2: FIELD NAME 1 Field2: FIELD NAME2 etc), starting left to right, how many fields would have to be combined in each table to represent a unique record.

For instance:

TYPE ID TEXT
1 1 "Cats"
1 2 "Dogs"
2 1 "Rabbits"

In this example a combination of the fields TYPE and ID give a unique record.

Any help most appreciated.

Dalien51

View 1 Replies View Related

Error 3022 Duplicate Entries

Aug 6, 2006

Hi,
I have a rather large database that was built in Access '97 and recently converted to 2003. I have a couple problems now. I get an error message about not being able to update the form because it would create a duplicate value in the primary key, index, or relationship. (Error 3022) I didn't build this particular database so I'm not totally sure why somethings are done the way they are. I've spent a long time going through everything to try to understand the relationships and I've asked lots of people at work to look at it, but no one seems to understand why it's doing what it's doing. The Access Help information has helped me understand some things better, but not this problem. I've gone through every table and removed all primary keys and set all indexes to allow duplicates. Then, when I was looking at the relationships and object dependancies, I think everything looks to be in order. However, when i add info directly to the table instead of using the form, the form is not updated with the new info. the table keeps the information, but isn't communicating with the form and i suspect reverse is true which is where the error is coming from. But how do I detect that for sure and how can I fix it with out starting over? I've gone through and added data to one field in the form at a time to try and narrow down what field is causing the problem, but no matter what i get the same error. Is there a way to find out exactly what field is causing the error? Thanks for any help you can offer!

Alicia

View 3 Replies View Related

Error 3022 - Duplicate Key/Index

Mar 1, 2007

Just when I thought I had my problem licked...

I created a subforum with an updateable query, and this works. I can view the results of the query, modify them and add new records.

However I shortly realized that once I deleted a record (either by some VBA code, or by SQL) that I could not re-add the same record through the subform.

I've made sure that the record is deleted, so there is no duplication of the key.
I've made sure that Index is Duplicates OK, so there is no duplication issues there.

What am I missing?

View 9 Replies View Related

Creating Duplicate Values Error

Mar 29, 2006

I have a table with one primary key (ClientID) which is an autonumber (cannot be duplicated), and another field which is a number field which is set to a random 6 digits (also cannot be duplicated) whenever a new client record is created.

Now, the main database is on a desktop, and my partner and i are connected to this main database through our laptops whenever we're in the office. For the last 6 months, I had only the ClientID in the form (from the Client Table), and everything would work fine whenever we created a new record in the Form, even if we created a new record at the same time on our personal laptops, the numbers would automatically be increased by one w/ no error.

I just added the other field now, the regular 6 digit random number field, and sometimes (only sometimes) when we both have a different client and start a new record, we get error messages that says we're creating duplicates. When that error message comes up, one of us has to close down the form completely, and reopen and start a new record again. Not sure why this is happening. Here is the error message.

http://members.shaw.ca/hgkma/errormessage.jpg

Any help appreciated.!!

View 14 Replies View Related

Check For Duplicate And Error Message

Nov 29, 2006

I have a form - see attached image.
The first text box is called Job_No. When a number is entered here how can I check that the number doesn't already exist when the user tabs to the next box. Then if it does exist display a custom message to the effect "This already exists" and not the Access default duplicate error message.

Thanks

Michael

View 1 Replies View Related

Duplicate Entry Error Message

Jul 7, 2006

Hi!

I have a form which is based on student records. What I'm trying to get Access to do is to bring up an error message as soon a duplicate student number has been entered. At present I've managed to replace the Access standard error message 3022 with my own by using the following code:

Private Sub Form_Error(DataErr As Integer, Response As Integer)
Const conDuplicateKey = 3022
Dim strMsg As String

If DataErr = conDuplicateKey Then
Response = acDataErrContinue
strMsg = "Duplicated record. Please recheck your data."
MsgBox strMsg
End If
End Sub

However the error message only appears when you try to leave the form (e.g. start a new record). I would like the error message to appear as soon as the user leaves the Student Number text box on the form. Is there anyway to do this?

View 3 Replies View Related

Key Auto-number Is Too Low - Getting Duplicate Error

Feb 12, 2012

I have a table with about 3600 keys, numbered from 1 to 3600. When I try to enter a new record, the autonumber starts in the 20's. I get an error message about duplicate keys, and I have to cancel. If I try again the autonumber goes up by one, but it will take hours to do this with approximately 3600 tries to get past the highest exisiting key number. Is there a way to make Access reset this? THis table is linked to a many-to-many table and I can't start over or I will lose all my relationships.

View 4 Replies View Related

Custom Error Message For Duplicate Data?

Apr 26, 2013

How to create custom error message for duplicate data? I want this custom message at text box before_update event not at form_error .....

View 1 Replies View Related

Weird Error Message On Prevent Duplicate Name Entry

Mar 7, 2005

So now, I'm using the code below to prevent duplicate name entry and it is working great - EXCEPT when I enter a first or last name which contains a ' (ie, O'Tool, O'Malley, O'Hern)...anyone got any ideas for me on how to make this not happen?

The error I get is:

Run Time error '3075'

Syntax error (missing operator) in query expression '[Last Name]='O'Hern' And [First Name]='Lori'.

The code i'm using is:

Private Sub Last_Name_AfterUpdate()

'Check for duplicate first and last name using DCount

If DCount("*", "[Constituents]", "[Last Name]= '" & Me![Last Name] & "' And [First Name] = '" & Me![First Name] & "'") > 0 Then
Beep
MsgBox "This first and last name already exists in the database. Please check that you are not entering a duplicate constituent before continuing.", vbOKOnly, "Duplicate Value"
Cancel = True
End If

CustID_Exit:
Exit Sub

CustID_Err:
MsgBox Error$
Resume CustID_Exit

End Sub

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved