ODBC Call Failed

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
 
G

Guest

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top