Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, November 25, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - Controls
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Controls | New ThreadView:  Search:  
 Author  Thread: OpenDialog control question
Karl Ku
Posts: 3
 
OpenDialog control questionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Mar 06 10:46 AM

buy naltrexone online usa

buy naltrexone without prescription go
fiogf49gjkf0d
Has anyone successfully used the OpenDialog control? Whenever I get the .FileName property I get some random gibberish instead of the file name. Is there something special that needs to be done to get this information? I'm using 6.2.3. I've got the OpenDialog control on the form and I have a button that calls the OpenDialog.execute method to show the dialog screen. Then I get the FileName property on a close event. It seems that it should be that simple, but is there more that needs to be done?


Code snippet below:

Sub cmdOpenFileClick(Sender)
odFile.FileName = empty
odfile.Execute
End Sub

Sub OpenDialog1Close(Sender)
msgbox sender.FileName
End Sub
[Reply][Quote]
Jay Welther
Posts: 28
 
Re: OpenDialog control questionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Mar 06 7:25 AM

fluoxetine capsules 20mg

fluoxetine 20mg tablets
Here are some code snippets from a routine I use to create a text file passed to an accounting system.
- opnFile is the OpenDialog control
- txtFile is an Edit control showing the default or selected filename
- cmdChange is a button control clicked to popup the Open Dialog and select or enter a different filename
- cmdOK is a button control clicked to create a temp text file. If successful it gets copied to the selected file.

sub AXForm_Change(Sender)
...
'set default output file for 4th Shift transfer
opnFile.DefaultExt = "txt"
txtFile.Text = "DefaultOrderTransferFileName"
opnFile.FileName = txtFile.Text
opnFile.Filter = "Text Files (*.txt)|*.txt"
...
end sub

sub cmdChange_OnClick(Sender)
opnFile.Execute
txtFile.Text = opnFile.FileName
end sub

sub cmdOK_Click(Sender)
...
'verify can open transfer output file
set fso = CreateObject("Scripting.FileSystemObject")
set objOutFile = fso.OpenTextFile(opnFile.FileName, cForAppending, True)
if not fso.FileExists(opnFile.FileName) then
ErrorMsg("Could not open transfer output file: " & opnFile.FileName)
CloseRS 2, objOutFile, fso
exit sub
end if
objOutFile.Close 'close for now, will reopen when ready to update
...
end sub

sub CopyOrderFile
objWrkFile.Close 'close the work file to end writing mode
set objWrkFile = fso.OpenTextFile(strWrkFile, cForReading, True)
if not fso.FileExists(strWrkFile) then
ErrorMsg("Could not open transfer work file for copy: " & strWrkFile)
exit sub
end if

'open transfer file
set objOutFile = fso.OpenTextFile(opnFile.FileName, cForAppending, True)
if not fso.FileExists(opnFile.FileName) then
ErrorMsg("Could not open transfer file for copy: " & opnFile.FileName)
exit sub
end if

'copy work file to transfer file
while not objWrkFile.AtEndOfStream
objOutFile.WriteLine(objWrkFile.ReadLine)
wend

objOutFile.Close
end sub
[Reply][Quote]
Karl Ku
Posts: 3
 
Re: OpenDialog control questionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Mar 06 12:21 PM

protopic

protopic wonderlandmakeups.pl
fiogf49gjkf0d
Thanks for the help. I was able to get it to work by putting the FileName property reference in the button click event. Looks like the FileName property is filled after the the Execute method completes and not available during the Onclose event.
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/25/2024 8:14:09 PM