Setting up forms for multiple users

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am setting up a form for multiple users. they will each have a password to
open to the form. How do I set the properties of the form so that the users
will only see their information to plug in or edit data, but not see other
users information?
 
BG,

It is not clear whether you mean each user will only be able to access
some of the records in the database, or whether different fields for
each record are only applicable to certain users.

If the first, I guess the easiest way would be to have a field in the
form's underlying table where the ID or password of the authorised user
is entered. If any given record can be legitimately opened by more than
one user, but not all, than you would need a separate table to store the
record authorisations.

If the second, you could use code on the After Update event of the
password control on the form, to enable/disable or show/hide the
applicable controls according to the "UserType" of the user logging in.
As an example, something along these lines (I have assumed you have a
multi-column combobox for the entry of the user, and its Row Source
includes a UserID, UserName, UserType, and Password, and another unbound
textbox where the user enters their password)...
If Me.Password = Me.User.Column(3)
Select Case Me.User.Column(2) ' UserType
Case "A"
Me.OneControl.Visible = True
Me.AnotherControl.Visible = False
Case "B"
Me.OneControl.Visible = False
Me.AnotherControl.Visible = True
End Select
Else
MsgBox "Invalid password"
End If

If you need more specific help with this, please post back with more
details, including examples.
 

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

Back
Top