A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Consistant error



 
 
Thread Tools Display Modes
  #1  
Old April 28th, 2004, 03:00 PM
Curt
external usenet poster
 
Posts: n/a
Default Consistant error

I tried multiple different changes, but without any luck
maybe someone here can help out on what I am doing wrong.
I keep getting a message:

The changes you requested to the table were not successful
because they could create duplicate values in the index,
primary key, or relationship. Change the value in the
fields or fields that contain duplicate data, remoce the
index, or redifine the index to permit duplicate entries
and try again. Now here is my code that I am using and I
get seem to figure out what is wrong.

vSSAN = Me.Parent.FMP.Column(0) & "/" & Me.Parent.SSAN
& " " & Me.Parent.FName & " " & Me.Parent.LName

End If
Set dbs = CurrentDb()
Set rst = OpenForSeek("tblFAM")
rst.Index = "SSAN"
rst.Seek "=", vSSAN
If Not rst.NoMatch Then
rst.Edit
rst.Update
rst.Close
dbs.Close
Else
Set rst = dbs.OpenRecordset("tblFAM")
rst.AddNew
rst![SSAN] = vSSAN
rst.Update
rst.Close
Me.Parent.FAMList.Requery
End If
  #2  
Old April 28th, 2004, 04:28 PM
Curt
external usenet poster
 
Posts: n/a
Default Consistant error

Never mind I fixed it for some reason it was trying to
create 2 records at the same time. I took out the
following

Set rst = dbs.OpenRecordset("tblFAM")
rst.AddNew
rst![SSAN] = vSSAN
rst.Update
rst.Close


and it still created a record if needed.

-----Original Message-----
I tried multiple different changes, but without any luck
maybe someone here can help out on what I am doing wrong.
I keep getting a message:

The changes you requested to the table were not

successful
because they could create duplicate values in the index,
primary key, or relationship. Change the value in the
fields or fields that contain duplicate data, remoce the
index, or redifine the index to permit duplicate entries
and try again. Now here is my code that I am using and I
get seem to figure out what is wrong.

vSSAN = Me.Parent.FMP.Column(0) & "/" & Me.Parent.SSAN
& " " & Me.Parent.FName & " " & Me.Parent.LName

End If
Set dbs = CurrentDb()
Set rst = OpenForSeek("tblFAM")
rst.Index = "SSAN"
rst.Seek "=", vSSAN
If Not rst.NoMatch Then
rst.Edit
rst.Update
rst.Close
dbs.Close
Else
Set rst = dbs.OpenRecordset("tblFAM")
rst.AddNew
rst![SSAN] = vSSAN
rst.Update
rst.Close
Me.Parent.FAMList.Requery
End If
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.