ODBC Call Failed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I run the following code, I'm getting and ODBC--Call Failed error message on the recordset update. Can anyone provide any insight on why this may be happening? I'm connecting to a SQL server through Access 2002. Any help would be greatly appreciated. Thanks!


Dim Valu As Variant
Dim RecSet As dao.Recordset
Dim DB As dao.Database


Set DB = CurrentDb
Set RecSet = DB.OpenRecordset("dbo_ProductionData", dbOpenDynaset, dbSeeChanges)

For Each Valu In Me.List397.ItemsSelected
RecSet.AddNew
RecSet!ProductionCount.Value = 0
RecSet.Update
Next Valu
 
I fixed the problem. I forgot to make sure that the foreign key was inserted into each record before it was updated. (BIG duuuuh to me). Thanks!
 
Back
Top