Problem with Common Dialog Control
I am having a problem using the Filter property of the common dialog control. When I try to add a filter, i get the following compile error "Invalid use of property"
Is there any reason for this? does the filter property have to be set in the Form_Load event?
This is what I have:
private Sub cmdOpenFile_Click()
on error resume next
CommonDialog1.Filter "FoxPro Programs (*.prg)|*.prg"
CommonDialog1.ShowOpen
me.txtFileName = CommonDialog1.FileName
me.lstPrgFiles.AddItem (CommonDialog1.FileName)
End Sub
Thanks!
~goddess
[email protected]
Re: Problem with Common Dialog Control
The problem I believe is not in Filter but in the line
me.lstPrgFiles.AddItem (CommonDialog1.FileName)
if you use CommonDialog1.FileName
then you will get the message - invalid use of property
try the following
r = CommonDialog1.FileName
me.lstPrgFiles.AddItem r
Iouri Boutchkine
[email protected]
Re: Problem with Common Dialog Control
I tried your suggestion, but I still get the same error on the filter property.
Is there anything else I can try?
~goddess
[email protected]
Re: Problem with Common Dialog Control
Maybe it is just a type error. I found you missed '='.
CommonDialog1.Filter = "FoxPro Programs (*.prg)|*.prg"
Regards,
Michi
Re: Problem with Common Dialog Control
Thanks! This worked great.
~goddess
[email protected]