| 10/30/2025 7:32:32 PM 
 
 
 
 
 
 
 
 | 
											
												| 
														
															|  | 
																	
																		| 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! 
| Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
 
 |  | 
 
 
 
		You can 
																				subscribe to receive a daily forum digest in your 
																					user profile. View the site code 
																					of conduct for posting guidelines.
			|  |  
			
		 
			|  | 
				
					| OpenDialog control question  Posted: 22 Mar 06 10:46 AM
 |  
					| buy naltrexone online usa  buy naltrexone without prescription gofiogf49gjkf0dHas 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
 
 |  
					|  |  |  
			|  | 
				
					| Re: OpenDialog control question  Posted: 23 Mar 06 7:25 AM
 |  
					| Here are some code snippets from a routine I use to create a text file passed to an accounting system.fluoxetine capsules 20mg  fluoxetine 20mg  tablets- 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
 
 |  
					|  |  |  
			|  | 
				
					| Re: OpenDialog control question  Posted: 23 Mar 06 12:21 PM
 |  
					| fiogf49gjkf0dThanks 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. |  
					|  |  |  
			|  |  
 
 
	
		| |  Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity! | 
 |  |  
 |  |  |  |  |