Hi, I have a database that needs bank account details adding with some degree of security. I took over the database from someone else and can't use the security wizard to implement proper security so i'm trying to create a workable solution. I've created a table to house the details in another DB which i've protected with the simple password security. I've also created a form in the front end where i want the details displayed. I have different user levels so I can restrict access to the button that opens the form.
I found some code on here about opening a password protected DB and modified it to try and set the recordsource of the form to the external table but I can't get it to work. I'm getting a type mismatch error because I don't think I can pass frmRST as the forms RecordSource. Can anyone fix my code or tell me a better way of doing it,
thanks, Tom.
I found some code on here about opening a password protected DB and modified it to try and set the recordsource of the form to the external table but I can't get it to work. I'm getting a type mismatch error because I don't think I can pass frmRST as the forms RecordSource. Can anyone fix my code or tell me a better way of doing it,
thanks, Tom.
Code:
Private Sub Form_Load()
Dim wrk As Workspace
Dim dbProtected As Database
Dim frmRST As Recordset
Set wrk = DBEngine.Workspaces(0)
Set dbProtected = wrk.OpenDatabase("H:\Tom Knight\AMacctDets.mdb", False, False, ";PWD=am")
Set frmRST = dbProtected.OpenRecordset("SELECT * FROM [tbl_AppAcctDets];")
Me.RecordSource = frmRST
End Sub