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

Is there a function that allows me to browse? 1

Status
Not open for further replies.

luismun

Programmer
Sep 10, 2002
9
0
0
US
Hey All,

Anybody there that can tell me how can I change path name (from the GUI-frontend) to connect to different databases (backend)? Currently, we manually type the path where the DB is located, but I would like to browse and using the mouse be able to move from folder to folder and click on the DB name. Let me know if you know what is the name of the function that allows me to build this feature.

Rgds,

LM
 
I am not sure exactly what it is that you want to do, but if you are needing to link your front end to different databases that are structural duplicates of each other, you might be able to modify the relinking code that I use.
 
Hey TommieB,

Thanks for your help. let me clarify what I want to do, I have a front-end icon call setup. The user types the path (C:\folder\dbname.mdb) and link to the backend. However, using the same frontend, they want to move from one database (backend) to another. So they have to remember the names of the backend and the paths to be able to type it. So, I want to add a feature where they click browse and they can search in different folders and select the *.mdb file to link. Just like in windows when you try to open a file and you can browse and select the file to open from different folders. is there anything in MS access that allows me to build a similar window to browse? Do you have a better idea on how to link to many DB simultaneously. The problem is that all of them have the same table names.
 
There is code at this web site - The very first one called
"Call the standard Windows File Open/Save dialog box" I believe you can get the path & filename of the database chosen (I would use the Open dialog box) then using that write code to link. I haven't tested or used the code. I've coded using the Windows Open/Save dialog in VB but not in Access. I thought it might give you someplace to start.
 
Thanks for your help laakins, I will try to see if Access Allows me to do something similar. I will let you know if I need more help. So far I have not found any function in Access similar to: ahtCommonFileOpenSave, hopefully there is one.
Rgds,

LM.
 
If you have not found an answer to this, here is an idea:

Add the "Common Dialog Control" (its under the more controls listing). Name it whatever (dlgCommon). To open the window to search for a file you use:

dlgCommon.ShowOpen

To reference whatever file they click on:

dlgCommon.FileName

You can also do saves this way with .showsave

Hope this helps you!
 
Hi, this topic came up in Access forms, I think a couple days ago. The question was regarding creating a dynamic link to connect to different db's . Fancy Prairie responded to it and provided the answer I think you're looking for.
 
laakins suggestion is one I've seen referred to often. Cruford's suggestion of using the Common Dialog Control is what I use.

The thread pdldavis referred to is thread702-469952.

It sounds like there is a finite number of databases to which the user can link. And your concern is that the users mistype the names. If you know the names of the databases the user can choose, why not just list the tables in a combobox (or listbox). Note that the names of the tables could be stored in a table.
 
Hi All,

Thanks for your answers, but I think there is a little confusion. I also have DB backend and GUI (frontend), we want to connect using the same GUI to different DBs (backend with diiferent names located in different directories). Currently, the user must manually modify the path name, for example: from c:\folder1\DB1A_JAN.mdb to c:\Folder5\DB3_FEB.mdb, but they forget the path names and names of the databases. So, I want to have a button that they can click and the window with the drives and floders appear. Then, the can move from folder to folder using the mouse, then they finally click on the name of the DB they want to connect to. This way they will never type the name. I already have a function that links all the tables after the name of the database has been found. linking is not the problem, typing the correct database path\name is the problem.

Bye the way, I don't have a "Common Dialgo Control" in my PC, I am using Access 2000. Do you know why I could not find it under more controls???
 
Try....

Dim dlg As FileDialog
Set dlg = Application.FileDialog(msoFileDialogOpen)
dlg.AllowMultiSelect = False
dlg.InitialFileName = "*.mdb"
dlg.Show
If dlg.SelectedItems.Count = 0 Then
MsgBox "Nothing selected"
Else
MsgBox dlg.SelectedItems(1), vbInformation, "Selected file..."
End If

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top