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

Creating a Custom Dialog

Status
Not open for further replies.

brandr

IS-IT--Management
Jul 7, 2007
7
GB
Hello all,<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I have a command button in a VB program which is used once a month to update a database file from a CDROM and onto the harddrive. Since most computers generally use the D drive for CDs I made this the default (so if the CDROM is in the D drive the FileCopy command will work). <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I want to create a custom dialog however, so on an error (when the CD drive isnt the D drive) a new form will launch allowing the user to browse through the computer's drives and select the approiate database file.&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I was wondering how I design the form so that if it appears the user is able to show VB where the auctual database file is. I'm not sure if the DriveListBox and DirListBox applies to this, but if it does I have absolutley NO idea on how to use these tools.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I appreciate any help that you can provide.<br><br>-Brandr Beekman<br><A HREF="mailto:bbeekman@rbscorp.com">bbeekman@rbscorp.com</A><br><br>
 
<br>&nbsp;Yes use Filelistbox,dirlistbox,and Drivelistbox to accomplish it. I have added code that I have used to do the appx same thing you want your program to do. It will allow you to change your Drive,Dir paths and selece an appropriate file to process.<br><br>In this case I made a form called loadform with the controls on it.<br>==========================================================<br><br>Option Explicit<br><br><br><br>Private Sub Dir1_Change()<br>File1.Path = Dir1.Path<br><br>End Sub<br><br>Private Sub Drive1_Change()<br>Dir1.Path = Drive1.Drive<br><br><br>End Sub<br><br>Public Sub File1_dblClick()<br><br>openfile = File1.FileName<br><br>Unload loadform<br><br><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;John Stephens
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top