Need assistance - ODBC vs VBA issues !

G

Guest

Hi,

I have a small interface that creates labels.
I put the amount of labels I want to create in the field
"QtyOfLabels" and then I press enter wich populate the fields PartID*,
WO, PartRev, PartModLvl, YearNo*, WeekNo* (SubForm).
"QtyOfLabels" and the subform are on the same form "Input".
Yesterday it was working just fine because my table
(Serial_Numbers_WW_YY_NNNN) was in my DB but
now that i've migrated it onto SQL 2000, i'm having troubles getting this
command to work!
I'm getting an Run-time errro '3146' : ODBC--CALL FAILED at ".Update"

I need you help !!

* fields are automaticaly filled when form is opened
=============================
Private Sub QtyOfLabels_AfterUpdate()
Dim dbs As DAO.Database, rstSN As DAO.Recordset
Dim strsql As String
Dim S As Integer

strsql = "Serial_Numbers_WW_YY_NNNN"
Set dbs = CurrentDb
Set rstSN = CurrentDb().OpenRecordset(strsql)
For S = SeqNo + 1 To SeqNo + Val(QtyOfLabels)
With rstSN
.AddNew
!Part_Number_ID = PartID
!Work_Order_Number = WO
!Part_Revision_Number = PartRev
!Part_Mod_Level = PartModLvl
!Year_number = YearNo
!week_number = WeekNo
!Seq_number = Format(S, "000#")
.Update
End With
Next S
'Qtyoflabels.Value = Null
SelectPN_AfterUpdate
rstSN.Close
End Sub
 
A

Andi Mayer

On Tue, 7 Dec 2004 08:23:02 -0800, MartyMart

the most important part is missing:

your connection to the SQL server

is it readOnly?????
If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
 
G

Guest

Hi Andi,

I have created a user on my SQL Server that have admin attributes on
the table (Labeluser)
From Access, i'm able to add and delete entries from my linked table.
So I know that my ODBC link is good.

Where do I put the connection to my SQL Server????

thanks alot!
 
A

Andi Mayer

Hi Andi,

I have created a user on my SQL Server that have admin attributes on
the table (Labeluser)
From Access, i'm able to add and delete entries from my linked table.
So I know that my ODBC link is good.
How have you linked the tables?

check the rstSN in the Watches Window to see the conectionstring and
look if it is updatable.

If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
 

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