any ideas for boolean yes/no field in table

  • Thread starter MUHAMAMD SALIM SHAHZAD
  • Start date
M

MUHAMAMD SALIM SHAHZAD

dear respected Gurus,

Sir, I created one table(say tblA has UserID/password) to verify, then
i Have another table(say TableB UserID/Allow(Yes/No), tableA has
1-many relations with tableB

now after succesfully login in the system, I want to check the user is
allowed to login/allow to open particular form or not? so on allow
field i put the yes/no for various users...

i try also dcount/dlookup, but could not success

any ideas what codes should i try or any hints can help me and
appreciate to learn as novice in access

regards yours student

shahzad
 
L

Larry Linson

I can tell you that no "homegrown" security scheme is likely to provide much
protection. Access has its own security features, and even those can be
hacked, but not nearly so easily as tables within the database itself.

Because I know that self-implemented security is not a productive use of
time, I have spent little time on the matter since the early 1990's when a
client insisted on "security lite" even after being advised that it was
useless even against relative novices who wanted access. That one was too
complex to explain in a newsgroup post, even if I remembered all the
details.

As you didn't describe the details of what you did, it will be difficult for
anyone to offer useful suggestions to improve it.

My suggestion is to download the security FAQ from the Microsoft site and
study it carefully, several times, before deciding whether to use it or not.
It is NON-trivial. Then again, so would be a scheme you implemented
yourself, and yours would ineffective, or less effective, just by nature of
where/how you have to keep the data,

Larry Linson
Microsoft Access MVP
 
P

Pieter Linden

Sir, I created one table(say tblA has UserID/password) to verify, then
i Have another table(say TableB UserID/Allow(Yes/No), tableA has
1-many relations with tableB

now after succesfully login in the system, I want to check the user is
allowed to login/allow to open particular form or not? so on allow
field i put the yes/no for various users...

i try also dcount/dlookup, but could not success

any ideas what codes should i try or any hints can help me and
appreciate to learn as novice in access

regards yours student

shahzad

Option Compare Database
Option Explicit

Private Sub Command2_Click()
If UserAllowed(Me.txtUsername) Then
DoCmd.OpenForm "Form1"
Else
MsgBox Me.txtUsername & " not allowed to open Form1"
End If
End Sub

Private Function UserAllowed(ByVal strUsername As String) As Boolean
Dim strSQL As String
Dim rs As DAO.Recordset

strSQL = "SELECT tblAllowOpen.AllowOpen FROM tblAllowOpen WHERE
tblAllowOpen.UserName ='" & Me.txtUsername & "';"
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)

UserAllowed = rs.Fields("AllowOpen")
rs.Close
Set rs = Nothing
End Function
 
A

Alan Webb

Muhamamd,
Dude, tie it to a client-server db engine like SQL Server or MSDE and rely
on the security there.
 
G

Genius Maximus

You should make accounts and permissions per account through the safety menu
of Access.
The helpfile can get you on the way.
Success
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top