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

invalid page fault fm20.dll

Status
Not open for further replies.

jshanoo

Programmer
Apr 2, 2002
287
IN
Hi all,
I am using office controls in Vb project .

Now it is working fine except that in some times it throws and error like:
' caused and invali dpage fault in module fm20.dll '
and soem binary numbers.
can any one help me with a solution to the same.
Regards
JOhn












*** Even the Best, did the Bad and Made the Best ***

John Philip
 
I have tried using Office controls in VB by adding the Microsoft Forms 2.0 object library. I presume you have done this also.

It worked for me, but I really wish now I had not tried doing it. The problems I had outweighed any benefits and made the app hard to maintain.

The main problem that I ran into was that Vb seems to not be able to identify the control type between the proper control and the Office control.

I do not recall all the errors I received before figuring this out, but I do recall that code like this worked:

Public Sub ClearTagCombo(ByVal f As Form)
On Error GoTo fail

Dim cbCtl As Control
For Each cbCtl In f.Controls
If cbCtl.Name = "cbfields" Then
cbCtl.Text = cbCtl.Tag
ElseIf TypeOf cbCtl Is DataCombo Then
cbCtl.BoundText = cbCtl.Tag
End If
Next cbCtl
Exit Sub
fail:
MsgBox Err.Description, vbExclamation

End Sub

But this would not

Public Sub ClearTagCombo(ByVal f As Form)
On Error GoTo fail

Dim cbCtl As Control
For Each cbCtl In f.Controls
If TypeOf cbCtl = combobox Then
cbCtl.Text = cbCtl.Tag
ElseIf TypeOf cbCtl Is DataCombo Then
cbCtl.BoundText = cbCtl.Tag
End If
Next cbCtl
Exit Sub
fail:
MsgBox Err.Description, vbExclamation

End Sub

I beleive that VB interprets the second code to be referring to the VB combobox and determines that the actual control is some unknown.

Additionally, I was unable to set properties for the office control where they were different from the VB control.

If you can I would not use the office controls.

Trust me on this. I can screw things up with the best of them and have tried this. There are much better ways.



Terry (cyberbiker)
 
Hi Terry,
Even i am using the office combo box control in the project.
But i am not using the 'typeof'.

Any guess where teh problem lies


Regards
John Philip

*** Even the Best, did the Bad and Made the Best ***

John Philip
 
I can only guess without seeing the code that generates the error.

I am guessing you what the auto complete feature of the office combo box.

check out thread 222-757158 for a better solution

That was my reason for trying to use the Office controls.

I did get mine to work well, but it is a nightmare to maintain and I repeat:

I would advise against doing it this way when better ways exist.

(I will rewrite my app as soon as I get time to fix it). I cannot even recall all the errors I "fixed" when I made this mistake.

If you are too far along to want to do this, post the code where the error occurs and I will try to guide you.



Terry (cyberbiker)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top