citychap26
Programmer
Hi
I have the following code from which I want to call a form object and pass the values from the form to the calling module. However the problem is that the code simply pops the form up and then moves to the next bit of code within the module giving me a nice run tinme error 94, how can I stop this?
Sub MakeConnection()
Dim frm As Form_frmConnection
Dim sDSN As String
Dim sPassword As String
Dim sUserName As String
Dim sDatabase As String
Dim sServer As String
'// Open form and let user type in info, then pass back into to this module.
Set frm = New Form_frmConnection
frm.Visible = True
'// Get all the connection details into local variables.
sUserName = frm.txtUserName
sPassword = frm.txtPassword
sDSN = frm.cmbDSN
sServer = frm.txtServer
sDatabase = frm.txtDatabase
MsgBox sUserName & ", " & sPassword
End
Cheers
S
I have the following code from which I want to call a form object and pass the values from the form to the calling module. However the problem is that the code simply pops the form up and then moves to the next bit of code within the module giving me a nice run tinme error 94, how can I stop this?
Sub MakeConnection()
Dim frm As Form_frmConnection
Dim sDSN As String
Dim sPassword As String
Dim sUserName As String
Dim sDatabase As String
Dim sServer As String
'// Open form and let user type in info, then pass back into to this module.
Set frm = New Form_frmConnection
frm.Visible = True
'// Get all the connection details into local variables.
sUserName = frm.txtUserName
sPassword = frm.txtPassword
sDSN = frm.cmbDSN
sServer = frm.txtServer
sDatabase = frm.txtDatabase
MsgBox sUserName & ", " & sPassword
End
Cheers
S