Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Time Error '91':

Status
Not open for further replies.

Gyanbaba

Programmer
Jan 9, 2014
2
BH
Hi,

I require to do some prior calculation to a IC Stock Transfer entry. For that I created a vb Application and add the transfer dll. Now when I try to read the values of the Transfer, except the details(grid fields) section I am able to read all other field values, through the DSORDERDETAIL_OnRecordChanged function, but when I try to read the grid values, it gives me Run Time Error: Object Variable or with block variable not set. I have already set the object DSORDERDETAIL as the AccpacDSControl.

Private Sub AccpacIC3410UICtrl1_OnUIAppOpened()
Set DSORDERDETAIL = AccpacIC3410UICtrl1.UIDSControls(4)
Me.Caption = AccpacIC3410UICtrl1.UISession.CompanyID
End Sub
Private Sub DSORDERDETAIL_OnRecordChanged(ByVal eReason As AccpacCOMAPI.tagEventReason, ByVal pField As AccpacDataSrc.IAccpacDSField, ByVal pMultipleFields As AccpacDataSrc.IAccpacDSFields)

Dim x As Integer

If eReason = RSN_ADDNEW Or RSN_UPDATE Then
ArrItemno(x) = Trim(pMultipleFields(1).Value) & "," & Trim(pMultipleFields(2).Value) & "," & Trim(pMultipleFields(3).Value)

Else
End If
End Sub

Can any body suggest how to read the grid values of the screen.

Thanks
 
You need to single step through your code and find out which object isn't initialized.
 
pMultiplefields isn't always populated. Look at pField as well.
 
I have tried with 'pField' also, and the same error comes. This only happens in the case when I pass the index of the Grid. both pField and pMultifield object gives the Run Time Error.
 
Why do you need to read the grid values vs. the underlying data source values?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top