Click to See Complete Forum and Search --> : Question: common Dialog Box error.


mroberts
February 22nd, 1999, 01:27 PM
Greetings.


I wrote this file open Dialog in VB 4, and it did work, however it seems to have Broke, and i was wondering what went wrong??? maybe someone can help.


this code did not break until i upgraded to VB 5.0. now i get the Error Method or data member not found.


i dont want to have to rewrite my app in VB 5.0 from scratch, can someone help direct me in the correct path... thanks.



Sub FOpenProc()

Dim RetVal

On Error Resume Next

Dim OpenFileName As String

frmMDI.CMDialog1.Filename = ""

frmMDI.CMDialog1.ShowOpen

If Err 32755 Then ' User chose Cancel.

OpenFileName = frmMDI.CMDialog1.Filename

' If the file is larger than 65K, it can't

' be opened, so cancel the operation.

If FileLen(OpenFileName) > 65000 Then

MsgBox "The file is too large to open."

Exit Sub


it is this line : frmMDI.CMDialog1.Filename = "" in the code that is causing the problem,,,, according to VB. but it may be anywhere in VB. this is the file, open box. nothing spectaculer here. im just at a loss.

satishchavan
February 18th, 2002, 03:06 AM
Hi,
Just make sure that u have not changes the name of MDIfoem or Common Dialog Control, The Error which u have listed occures only when u have used wrong nwme of the variable or that method or property u have used is not valid.... in ur case the first case is happeneing
so just check the names of variables

Regards
Satish