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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Method 'Item' of object 'IAccpacDSFields' failed

Status
Not open for further replies.

irenavassilia

Programmer
Jun 19, 2007
101
Hi,

I'm new to Accpac programming as well. I find it pretty basic and simple since its basic VBA programming with Accpac databases.
I was recently creating an application with Accpac v5.3B.
Everything was working fine until i switched the application to run as Accpac v5.4A.

This is the code where my problem arises:

Private Sub cmdNotes_Click()
Dim nullAccount As String
Dim strGLAccount As String
Dim strPath As String
Dim strgldesc As String

If dsGLAccount.Fields("ACCTID") = "" Then
nullAccount = MsgBox("Please select the GL Account", vbExclamation + vbOKOnly)
Else

strGLAccount = dsGLAccount.Fields("ACCTID")
strgldesc = dsGLAccount.Fields("ACCTDESC")

strPath = pstrNotesPath & " " & strGLAccount
Call modLaunch.LaunchApp(strPath)
End If

End Sub

What happens here is the ACCTID and ACCRDESC fields are pre-populated into another VBA application.
Just the ACCTID field works great! However no another field from the view that I'm pulling this out of is working :(...

It gives me the error:
Method 'Item' of object 'IAccpacDSFields' failed
The Runtime error is -2147467259(80004005)
Basically the Method of object failed right?

I've looked all over the internet for some sort of help.
And everywhere it says it could be the dll or mismatch MDSN.
That is not the case here, I've checked all the references and the dll needed for Accpac, its all there...

Is this too much? lol i dont know my first time making a post..

Hopefully someone will help.

Thanks for your time, Irena
 
Try
Code:
dsGLAccount.Read
after the
Code:
strGLAccount = dsGLAccount.Fields("ACCTID")
line.
 
I fixed the problem with an Accpac Browser object, but this seems alot simpler then what i did, i'll try it out.

I have another small issue:

Sub SetPartFocus()
frmNotes.rtbParticulars.SetFocus
frmNotes.rtbParticulars.SelStart = 0
frmNotes.rtbParticulars.SelLength = 12
SendKeys "{DELETE}"
End Sub

When i call SetPartFocus from a module:

If frmNotes.rtbParticulars.Text = "" Then
frmNotes.rtbParticulars.Text = "Particulars Comments"
Else
Call SetPartFocus
End If

It gives me Runtime error 91 Invalid procedure call or argument.
In the form it doesnt give me this error only in the module.

Thanks.

Regards,

Irena
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top