Hi,
All,
The code below is working but i want i don't need to open a new database.
Can someone help me with the code change, i need this connection but to use on a open database.
And i can't use Currentdb because i want to link to another database that is opened too.
Private Sub Command25_Click()
Dim strAppName
Dim strAppFrontEnd
Dim db As Access.Application
Set db = CreateObject("Access.Application")
strAppName = "Complaints1"
strAppFrontEnd = "Complaints07.mdb"
Set fso = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("Wscript.Shell")
' Get User Profile
strUserProfile = oShell.ExpandEnvironmentStrings("%USERPROFILE%")
pathdb = strUserProfile & "\" & strAppName & "\" & strAppFrontEnd
db.OpenCurrentDatabase (pathdb)
teste = db.Forms!Gestion!txtTextoReclamacion
End Sub
All,
The code below is working but i want i don't need to open a new database.
Can someone help me with the code change, i need this connection but to use on a open database.
And i can't use Currentdb because i want to link to another database that is opened too.
Private Sub Command25_Click()
Dim strAppName
Dim strAppFrontEnd
Dim db As Access.Application
Set db = CreateObject("Access.Application")
strAppName = "Complaints1"
strAppFrontEnd = "Complaints07.mdb"
Set fso = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("Wscript.Shell")
' Get User Profile
strUserProfile = oShell.ExpandEnvironmentStrings("%USERPROFILE%")
pathdb = strUserProfile & "\" & strAppName & "\" & strAppFrontEnd
db.OpenCurrentDatabase (pathdb)
teste = db.Forms!Gestion!txtTextoReclamacion
End Sub