Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Operation must be an updateable query error

Status
Not open for further replies.

cammi

Programmer
May 3, 2001
13
US
I have a function in Access 2000 that keeps giving me an "Operation must be an updateable query" error every time I try and tab from the field. I am only trying to update a field linked SQL table (autonumber). I can run a query in the SQL analyzer and the update works fine, but for some reason, this doesn't want to work in Access. Any help would be appreciated.

Private Sub QTM_QuoteID_Exit(Cancel As Integer)
Dim NextNumber As Integer
DoCmd.SetWarnings False
If IsNull(Me![QTM_QuoteID]) Then
Me![QTM_QuoteID] = DLookup("[AutoNumber_NextID]", "AutoNumber", "[AutoNumber_Setting] = 'QCT_NN_NextQQuoteNbr'")
NextNumber = Format(Me![QTM_QuoteID], "##0")
Me!TextNextNumber = NextNumber + 1
'DoCmd.OpenQuery "qryUpdateNextNumber"
'CSmith 10/3/01 - Updated to DoCmd.RunSQL; Autonumber wasn't allowing for update when tabbing from field.
DoCmd.RunSQL "update autonumber set AutoNumber_NextID = AutoNumber_NextID+1 where AutoNumber.AutoNumber_Setting ='QCT_NN_NextQQuoteNbr';"

End If
Me![TabCtl27].Visible = True
DoCmd.SetWarnings True
End Sub
 

Does the table Autonumber have a Primary Key, unique index or timestamp column. It must have one of those to be updateable from Access. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Yes it contains a timestamp column. If I view the records in access the column looks as if there are no values in it, however viewing the table in SQL Server, the table contains "Binary" in the column. One thing I noticed in the properties of the Autonumber was that the field could be null. There are no primary keys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top