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

Why doesnt this work?

Status
Not open for further replies.

mettodog

Vendor
Jul 11, 2000
94
US
If Me.OpenText.FileName = "*.pge" Then Me.Icon = pge.Picture
If Me.OpenText.FileName = "*.note" Then Me.Icon = note.Picture
 
If Me.OpenText.FileName = "*.pge" Then Me.Icon = loadpicture("pge.Picture")
If Me.OpenText.FileName = "*.note" Then Me.Icon = loadpicture("note.Picture ")
David Paulson


 
thanks for your help, but the form when loaded still displayes the vb icon.
 
OK, How about this

If right$(Me.OpenText.FileName,3) = "pge" Then Me.Icon = loadpicture("pge.Picture")
If right$(Me.OpenText.FileName,4) = "note" Then Me.Icon = loadpicture("note.Picture ")



David Paulson


 
that worked, but i had to change a few things. this is what the code is in case anyone is interested:


If Right$(Me.OpenText.FileName, 3) = "pge" Then Me.Icon = pge.Picture
If Right$(Me.OpenText.FileName, 4) = "note" Then Me.Icon = note.Picture

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top