944,060 Members | Top Members by Rank

Ad:
Aug 14th, 2007
0

need help...

Expand Post »
hi.. I have a problem on opening 2 file ... as below is my code... I want to open 1 file let's say .Dat file and it will trigger the other .Hdr file. the only different is the extension name , 11U06P0434FN.dat and 11U06P0434FN.hdr .... anyone can help me .... please .

CommonDialog1.Filter = ".Dat"
CommonDialog1.InitDir = App.Path & "\BatchFile"
CommonDialog1.FileName = ""
CommonDialog1.ShowOpen

txtdata(0).Text = rtndirectory(Trim(CommonDialog1.FileTitle))
If Trim(CommonDialog1.FileName) = "" Then Exit Sub
DatFName = CommonDialog1.FileName

CommonDialog1.ShowOpen
txtdata(1).Text = rtndirectory(Trim(CommonDialog1.FileTitle))
HdrFName = CommonDialog1.FileName

End Sub
Reputation Points: 10
Solved Threads: 0
Light Poster
coco86 is offline Offline
35 posts
since Jul 2007
Aug 14th, 2007
0

Re: need help...

So if you mean that you don't get the option to open multiple type files, then you need to change your code slightly.

CommonDialog1.Filter = "Dat File (*.Dat)|Hdr File (*.Hdr)"

This will give you option to open both type of files
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006
Aug 14th, 2007
0

Re: need help...

thnx binoj_daniel..
Reputation Points: 10
Solved Threads: 0
Light Poster
coco86 is offline Offline
35 posts
since Jul 2007
Aug 14th, 2007
0

Re: need help...

Let me know if that worked?
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006
Aug 14th, 2007
0

Re: need help...

you can also register on my site for more tech articles. click here to visit my site
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006
Aug 15th, 2007
0

Re: need help...

Hi,

use ur code to open Dat file and then get the header file by just replacing last 3 chars:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. DatFName = CommonDialog1.FileName
  2. HdrFName = Replace(LCase(DatFName),".dat",".hdr")

Or

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. DatFName = CommonDialog1.FileName
  2. HdrFName = Left(DatFName,Len(DatFName)-3) & "hdr"

Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Aug 15th, 2007
0

Re: need help...

thnx veena , it works .... i use the 2nd one u gave me.... thnx alot.....
Reputation Points: 10
Solved Threads: 0
Light Poster
coco86 is offline Offline
35 posts
since Jul 2007
Aug 15th, 2007
0

Re: need help...

thnx veena .... it works .... i use the 2nd one u gave me..... appreciate it....
Reputation Points: 10
Solved Threads: 0
Light Poster
coco86 is offline Offline
35 posts
since Jul 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: guide me pls....
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Add color palette to form





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC