HELP - We can't add records anymore

M

melwester

I've spent the last 6 months building this database. Finally, got it working
correctly for about 2 days. Now it stop adding records. WHY????

The tables all have primary kieys. I've noticed that the AutoNumber
(primary key) is duplicating it's numbers even through I've set it to (No
Duplicates).

We get this message "The changes you requested in the table were not
successful beasue they would create duplicate values in the table...."

Please someone help us.

Thank you.
 
D

David Lloyd

I don't know what version of Access you are running, or all the specifics of
your database, however, the following KB article deals with a similar issue
so I am passing it along as a potential reference.

http://support.microsoft.com/default.aspx?scid=kb;en-us;884185

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


I've spent the last 6 months building this database. Finally, got it
working
correctly for about 2 days. Now it stop adding records. WHY????

The tables all have primary kieys. I've noticed that the AutoNumber
(primary key) is duplicating it's numbers even through I've set it to (No
Duplicates).

We get this message "The changes you requested in the table were not
successful beasue they would create duplicate values in the table...."

Please someone help us.

Thank you.
 
M

melwester

Well, we've tried to download the updates and still it doesn't work.

The problem lies in when a user (this is a multi user database) tries to add
a new record. The "New Record" button gives the message of "The changes you
requested in the tabler were not successful because they would create
duplicate values in the Table ...." And the AutoIDNum brings up a lower
number that has already been used.

The AutoIdNum is set up in the table as Long Integer, Increment and Indexed
as Yes (No Duplicates) and is also the Primary Key.

Here is the code for the "Add Member Firm":

Private Sub Command20_Click()
On Error GoTo Err_Command20_Click


If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
DoCmd.Save Me.MemberFID
Else
RunCommand acCmdRecordsGoToNew
Me.[Command20].SetFocus
End If


Exit_Command20_Click:
Exit Sub

Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click

End Sub

Private Sub Command22_Click()
On Error GoTo Err_Command22_Click


DoCmd.Close

Exit_Command22_Click:
Exit Sub

Err_Command22_Click:
MsgBox Err.Description
Resume Exit_Command22_Click

End Sub

Private Sub CANCEL_Command_Click()
On Error GoTo Err_CANCEL_Command_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Me.Undo

Exit_CANCEL_Command_Click:
Exit Sub

Err_CANCEL_Command_Click:
MsgBox Err.Description
Resume Exit_CANCEL_Command_Click

End Sub

Please Help us. We need to get this database up and running smoothly by
this Friday (Dec 16th).

Donna
 
V

Van T. Dinh

I am not sure what you are trying to do with this statement:

DoCmd.Save Me.MemberFID

Check Access VB Help on the Save method of the DoCmd object. I don't think
you used it correctly.

--
HTH
Van T. Dinh
MVP (Access)



melwester said:
Well, we've tried to download the updates and still it doesn't work.

The problem lies in when a user (this is a multi user database) tries to
add
a new record. The "New Record" button gives the message of "The changes
you
requested in the tabler were not successful because they would create
duplicate values in the Table ...." And the AutoIDNum brings up a lower
number that has already been used.

The AutoIdNum is set up in the table as Long Integer, Increment and
Indexed
as Yes (No Duplicates) and is also the Primary Key.

Here is the code for the "Add Member Firm":

Private Sub Command20_Click()
On Error GoTo Err_Command20_Click


If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
DoCmd.Save Me.MemberFID
Else
RunCommand acCmdRecordsGoToNew
Me.[Command20].SetFocus
End If


Exit_Command20_Click:
Exit Sub

Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click

End Sub

Private Sub Command22_Click()
On Error GoTo Err_Command22_Click


DoCmd.Close

Exit_Command22_Click:
Exit Sub

Err_Command22_Click:
MsgBox Err.Description
Resume Exit_Command22_Click

End Sub

Private Sub CANCEL_Command_Click()
On Error GoTo Err_CANCEL_Command_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Me.Undo

Exit_CANCEL_Command_Click:
Exit Sub

Err_CANCEL_Command_Click:
MsgBox Err.Description
Resume Exit_CANCEL_Command_Click

End Sub

Please Help us. We need to get this database up and running smoothly by
this Friday (Dec 16th).

Donna


Van T. Dinh said:
If you use A2000, see the Microsoft Knowledge Base article:

http://support.microsoft.com/?id=257408

for A2002:

http://support.microsoft.com/?id=291162
 
Top