Will this be an administrator within your application or the windows administrator?
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
Try the following -
Dim cnPrint As ADODB.Connection
Set cnPrint = New ADODB.Connection
Dim rsPrint As ADODB.Recordset
Set rsPrint = New ADODB.Recordset
Dim MyCon As String
MyCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\MyData.MDB;Persist Security Info=False"
cnPrint.Open MyCon
If rsPrint.State = adStateOpen Then rsPrint.Close
rsPrint.Open "SELECT * FROM MyTable WHERE UserType =" & "'" & text1.Text & "'", cnPrint, adOpenStatic, adLockOptemistic
'Or
rsPrint.Open "SELECT * FROM MyTable WHERE UserYesNo =" & "'Yes'", cnPrint, adOpenStatic, adLockOptemistic
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
Put all of the above code under ONE event, say a button click event.
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350