M
MartyMart
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
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