473,467 Members | 1,477 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Unique Table is nonexistent or not completely specified error

46 New Member
I created a form in Access to store and retrieve data from a sql server table.

When i go and try to add a record to the form - i get the error: Unique Table is nonexistent or not completely specified

however if i try to add the same record to the backend database (in sql server), it gets added perfectly. What am i doing wrong?

I am using an field called recno as my unique identifier, it is to increment by 1 whenever i add a new record. i notice that when trying to add a new record through access - the new number does not display, it displays a # and never gets to a number, then i get the error.


here's the code behind my form.
Option Compare Database

Private Sub btnRefresh_Click()
Call PopulateData
End Sub

Private Sub Form_Load()

End Sub

Private Sub Form_Open(Cancel As Integer)
Me.Detail.Visible = True
Me.cbxAcYear.DefaultValue = 2008
Me.cbxQuarter.DefaultValue = 1
End Sub

Sub PopulateData()
Dim sqltext As String
'---- Form datasource
sqltext = "Select * from SuperSchoolAttendance " & _
"where acyear=" & Me.cbxAcYear & _
" and quarter=" & Me.cbxQuarter & _
" order by 1"
'Debug.Print sqltext
Me.RecordSource = sqltext
Me.txtAcYear.DefaultValue = Me.cbxAcYear
Me.txtQuarter.DefaultValue = Me.cbxQuarter
Debug.Print sqltext
Me.Refresh
Me.Detail.Visible = True
End Sub
Private Sub cbxAcyear_AfterUpdate()
' Call PopulateData
End Sub


Private Sub CommandDelete_Click()
Dim ok As Integer
ok = MsgBox("Are you sure you want to delete " & _
Me.txtRecno & "?", vbOKCancel, "Warning")
If ok = vbOK Then
Dim sqltext As String
sqltext = "Delete from SuperSchoolAttendance " & _
"where recno=" & Me.txtRecno
DoCmd.RunSQL sqltext
Me.Refresh
End If
End Sub



Private Sub btnAdd_Click()
Me.AllowAdditions = Not Me.AllowAdditions()

End Sub
Jul 8 '08 #1
0 2060

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Westcoast Sheri | last post by:
Which will be a faster lookup of an item by, "color" in the following mySQL tables: "unique key," "primary key," or just plain "key"?? CREATE TABLE myTable ( number int(11) NOT NULL default '0',...
26
by: Agoston Bejo | last post by:
I want to enforce such a constraint on a column that would ensure that the values be all unique, but this wouldn't apply to NULL values. (I.e. there may be more than one NULL value in the column.)...
5
by: Kamil | last post by:
Hello What should I use for better perfomance since unique constraint always use index ? Thanks Kamil
1
by: Rajesh Kumar Mallah | last post by:
Hi , Looks like ADD UNIQUE( some_fuc( some_feild) ) is not supported with add constraint. the only way is to add the constriant is using UNIQUE INDEX . Is it a bug or intended behaviour? ...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
10
by: Laurence | last post by:
Hi there, How to differentiate between unique constraint and unique index? These are very similar but I cannot differentiate them? Could someone give me a hand? Thanks in advance
1
by: ken_knee | last post by:
I have a PARENT/CHILD I'm attempting to attach another CHILD to. When I try to add a FOREIGN KEY to the 3rd table referring to CHILD1 (AGTERNS), I get error SQL0573N A column list specified in the...
1
by: L&G via DotNetMonster.com | last post by:
hi. ive 3 tables in my access database file. table people to table sales is a one to many relationship, and the same goes for Table sales and Table receipt . i find that in my initial...
2
by: Jimmy Stewart | last post by:
Ok, I'm trying to write a query that is starting to wear me down. What I'm trying to do is create a year end report that gets sent to all of my customers who meet two criteria. One they are...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.