DougAtAvalon
Programmer
I am trying to write information to another db without linking tables
I get a pop up to choose the db type. I think I can use the "connection" argument for this but I can't figure it out. It's the OpenDatabase line . . .
*****************
Private Sub BSecurityOnOff_Click()
On Error Resume Next
Dim strSQL As String
Dim ws As Workspace, db As Database, rs As Object
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase(vNetworkPath, , False)
strSQL = "SELECT DefaultSettings.*, DefaultSettings.DefaultID FROM DefaultSettings WHERE DefaultID = 'SecurityOn'"
Set rs = db.OpenRecordset(strSQL)
rs.Edit
If rs![DefaultValue] = 0 Then vRecordset!DefaultID = -1
If rs![DefaultValue] = -1 Then vRecordset!DefaultID = 0
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
ws.Close
Set ws = Nothing
SecurityRedefined
End Sub
***********
-Doug
I get a pop up to choose the db type. I think I can use the "connection" argument for this but I can't figure it out. It's the OpenDatabase line . . .
*****************
Private Sub BSecurityOnOff_Click()
On Error Resume Next
Dim strSQL As String
Dim ws As Workspace, db As Database, rs As Object
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase(vNetworkPath, , False)
strSQL = "SELECT DefaultSettings.*, DefaultSettings.DefaultID FROM DefaultSettings WHERE DefaultID = 'SecurityOn'"
Set rs = db.OpenRecordset(strSQL)
rs.Edit
If rs![DefaultValue] = 0 Then vRecordset!DefaultID = -1
If rs![DefaultValue] = -1 Then vRecordset!DefaultID = 0
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
ws.Close
Set ws = Nothing
SecurityRedefined
End Sub
***********
-Doug