S
Steven
I want to return a password that is in a function in a module in a separate
database. I have a small example here. The database I am in is db2 ; I want
to return a password out of a module in db1.
Here is what I have so far.
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim db As DAO.Database
Dim ws As DAO.Workspace
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase("C:\db1.mde", False, False)
'**Question - How do I call a Function in a Module in db1.mde that will
set the password and return it for use in db2?
ws.Close
Set ws = Nothing
db.Close
Set db = Nothing
'**Show MsgBox with password from db1.mde**
MsgBox vPassword01
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
--------------Module1 in db1.mde----------------
Function SetPassword()
Dim vPassword01 as String
vPassword01 = "itworksgreat"
End Function
Thank you for your help,
Steven
database. I have a small example here. The database I am in is db2 ; I want
to return a password out of a module in db1.
Here is what I have so far.
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim db As DAO.Database
Dim ws As DAO.Workspace
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase("C:\db1.mde", False, False)
'**Question - How do I call a Function in a Module in db1.mde that will
set the password and return it for use in db2?
ws.Close
Set ws = Nothing
db.Close
Set db = Nothing
'**Show MsgBox with password from db1.mde**
MsgBox vPassword01
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
--------------Module1 in db1.mde----------------
Function SetPassword()
Dim vPassword01 as String
vPassword01 = "itworksgreat"
End Function
Thank you for your help,
Steven