O
OD
Hi
I've been stuck on this for a week now. Someone was nice enough to point me
in the right direction but I can't figure it out. In this code my recordset
keeps returning nothing from the class object even though there is
information in the object.
Private Sub Form_Load()
On Error GoTo HandleError
Set objPurchase = New clsPurchase
objPurchase.ClearObject
Set rsPurchase = New ADODB.Recordset
blnAllRecords = True
Call LoadRecords
Exit Sub
Sub LoadRecords()
On Error GoTo HandleError
intCurPurchRecord = 0
blnAddMode = False
Set rsPurchase = objPurchase.RetrievePurchase(blnAllRecords)
If rsPurchase.BOF And rsPurchase.EOF Then
MsgBox "There are no records in the database"
Exit Sub
Else
objPurchase.PopulatePropertiesFromRecordset rsPurchase
Call MoveToFirstRecord(intCurPurchRecord, rsPurchase, objPurchase,
blnAddMode)
Call PopulatePurchaseControls
End If
Exit Sub
Private Sub Class_Initialize()
PRNum = vbNullString
PRID = 0
PONum = vbNullString
BFID = vbNullString
Requestor = vbNullString
Ext = vbNullString
Bldg_Floor = vbNullString
ReqDate = "1/1/1900"
Client_Name = vbNullString
Business_Line = vbNullString
RCNumber = vbNullString
Approval1 = vbNullString
Approval2 = vbNullString
End Sub
Sub ClearObject()
On Error GoTo HandleError
Me.PRNum = " "
Me.ReqDate = Now()
Me.Requestor = " "
Me.Ext = " "
Me.RCNumber = " "
Me.Client_Name = " "
Me.Business_Line = " "
Me.Approval1 = " "
Me.Approval2 = " "
Exit Sub
Let me know if you need or wish to see more. Any help is greatly
appreciated. Thank you
I've been stuck on this for a week now. Someone was nice enough to point me
in the right direction but I can't figure it out. In this code my recordset
keeps returning nothing from the class object even though there is
information in the object.
Private Sub Form_Load()
On Error GoTo HandleError
Set objPurchase = New clsPurchase
objPurchase.ClearObject
Set rsPurchase = New ADODB.Recordset
blnAllRecords = True
Call LoadRecords
Exit Sub
Sub LoadRecords()
On Error GoTo HandleError
intCurPurchRecord = 0
blnAddMode = False
Set rsPurchase = objPurchase.RetrievePurchase(blnAllRecords)
If rsPurchase.BOF And rsPurchase.EOF Then
MsgBox "There are no records in the database"
Exit Sub
Else
objPurchase.PopulatePropertiesFromRecordset rsPurchase
Call MoveToFirstRecord(intCurPurchRecord, rsPurchase, objPurchase,
blnAddMode)
Call PopulatePurchaseControls
End If
Exit Sub
Private Sub Class_Initialize()
PRNum = vbNullString
PRID = 0
PONum = vbNullString
BFID = vbNullString
Requestor = vbNullString
Ext = vbNullString
Bldg_Floor = vbNullString
ReqDate = "1/1/1900"
Client_Name = vbNullString
Business_Line = vbNullString
RCNumber = vbNullString
Approval1 = vbNullString
Approval2 = vbNullString
End Sub
Sub ClearObject()
On Error GoTo HandleError
Me.PRNum = " "
Me.ReqDate = Now()
Me.Requestor = " "
Me.Ext = " "
Me.RCNumber = " "
Me.Client_Name = " "
Me.Business_Line = " "
Me.Approval1 = " "
Me.Approval2 = " "
Exit Sub
Let me know if you need or wish to see more. Any help is greatly
appreciated. Thank you