J
JimS
I guess you guys can tell I have a new project underway. I appreciate your
patience.
I wrote a dirt-simple new class (A2007) which I'll be fleshing out further
later, but testing it is giving me fits. Herewith the class (clsPickList,
compiles fine...)
------------------
Private m_lngBoMID As Long
Dim rstPickListMaster As New ADODB.Recordset
Dim rstpicklistdetail As New ADODB.Recordset
Private Sub Class_Initialize()
Debug.Print "clsPickList Initialized at " & Now()
rstPickListMaster.Open "tblPickListMaster", CurrentProject.Connection,
adOpenDynamic, adLockBatchOptimistic
rstpicklistdetail.Open "tblPickListDetail", CurrentProject.Connection,
adOpenDynamic, adLockBatchOptimistic
End Sub
Public Function NewList()
With rstPickListMaster
If Not .EOF Then Debug.Print !PicklistID
.AddNew
!PicklistBoMID = m_lngBoMID
!PicklistDropLocation = ""
!PicklistNotifyNbr = ""
!PicklistDescription = ""
!PicklistPriority = "N"
.Update
Debug.Print !PicklistID
NewList = !PicklistID
End With
End Function
Public Property Set BoMID(NewValue As Variant)
m_lngBoMID = CLng(NewValue)
End Property
Public Property Get BoMID()
BoMID = m_lngBoMID
End Property
--------------------------------------
And my test logic in a code module I execute with F5 for testing (not too
complicated...)
--------------------------------------------
Sub blah()
Dim x As New clsPickList
x.BoMID = 40
x.NewList
Set x = Nothing
End Sub
patience.
I wrote a dirt-simple new class (A2007) which I'll be fleshing out further
later, but testing it is giving me fits. Herewith the class (clsPickList,
compiles fine...)
------------------
Private m_lngBoMID As Long
Dim rstPickListMaster As New ADODB.Recordset
Dim rstpicklistdetail As New ADODB.Recordset
Private Sub Class_Initialize()
Debug.Print "clsPickList Initialized at " & Now()
rstPickListMaster.Open "tblPickListMaster", CurrentProject.Connection,
adOpenDynamic, adLockBatchOptimistic
rstpicklistdetail.Open "tblPickListDetail", CurrentProject.Connection,
adOpenDynamic, adLockBatchOptimistic
End Sub
Public Function NewList()
With rstPickListMaster
If Not .EOF Then Debug.Print !PicklistID
.AddNew
!PicklistBoMID = m_lngBoMID
!PicklistDropLocation = ""
!PicklistNotifyNbr = ""
!PicklistDescription = ""
!PicklistPriority = "N"
.Update
Debug.Print !PicklistID
NewList = !PicklistID
End With
End Function
Public Property Set BoMID(NewValue As Variant)
m_lngBoMID = CLng(NewValue)
End Property
Public Property Get BoMID()
BoMID = m_lngBoMID
End Property
--------------------------------------
And my test logic in a code module I execute with F5 for testing (not too
complicated...)
--------------------------------------------
Sub blah()
Dim x As New clsPickList
x.BoMID = 40
x.NewList
Set x = Nothing
End Sub