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

More than 1 MDB

Status
Not open for further replies.

shyamsundar

Programmer
Aug 23, 2002
75
IN
Hi,

I have different MDB files for Different Locations, I want to select the MDB files according to the user's selection.

And.... I want to show a Acrobat file in ACCESS (not inserting or linking an object in a field). Is it possible thru actives, if yes, what is ocx file name.

Help...please.

Thanx
Shyam Shyam
cwizshyam@yahoo.com
 
Trying the solution for the above question I found the following error.. please help

I have created a combo box, and allowed the user to select the file name. My code is as follows

Private Sub Combo0_Change()
MsgBox Combo0.Value
Dim wsp As Workspace
Dim dbs As Database, dbsAnother As Database
Dim strMDB As String
strMDB = "'" & Combo0.Value & "'"
Set dbs = CurrentDb
Set wsp = DBEngine.Workspaces(0)
--> Set dbsAnother = wsp.OpenDatabase(strMDB)
Set dbs = Nothing
Set dbsAnother = Nothing
End Sub

I found the error at the arrow, file not found, but the file is there in the same folder, pl.help.

Shyam


Shyam
cwizshyam@yahoo.com
 
Hi Shyam,

Try changing this line:

[red]strMDB = "'" & Combo0.Value & "'" [/red]

To This:

[red]strMDB = Combo0.Value[/red]

Ler me know if this helps.
Regards,
gkprogrammer
 
Hi Gkprogrammer,

I tried your code as well as the below code

Set dbsAnother = wsp.OpenDatabase(combo0.value)

Same error....pl. help me

Shyam Shyam
cwizshyam@yahoo.com
 
Hello Again Shyam,

It is wierd that it doesn't work for you, are you sure that the file path is exactly as displayed in the combobox? You could also eliminate the need for a Workspace object by using the following:

Private Sub Combo0_Change()
MsgBox Combo0.Value
Dim dbs As Database, dbsAnother As Database
Set dbs = CurrentDb
[red]Set dbsAnother = DBEngine(0).OpenDatabase(Combo0.Value)[/red]
Set dbs = Nothing
Set dbsAnother = Nothing
End Sub Regards,
gkprogrammer
 
hi,

I am thru with opening other database it was path problem, thanx,now I want to open the forms & other objects of that database, how???pl. help Shyam
cwizshyam@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top