|
 |
access thread: Creation of USER/LOGIN Box & RECORD COUNTER
Message #1 by "Rick N" <loonievisa@h...> on Mon, 19 Aug 2002 14:11:38 -0600
|
|
I have two (2) problems and hope someone can show me the sunshine.
Situation #1:
I have two (2) main menus. One is for administration & the other is for
Guests. When the user types in "Guest" the Guest Main Menu would display.
Question:
1. What is the procedure to create a USER/LOGIN box? (just like how when one
has to type in USERNAME & Password in email).
Situation #2:
I have created a SEARCH FORM. When a search is done, and the database have
found 3 records, the confirmation box displays "Record Found."
Question:
2. I would like the msg to display "3 Records Found" or "0 Record found."
How do I do a Record Counter(?) I'm not sure if that's the correct
definition.
Any help is greatly appreciated!
Rick
_________________________________________________________________
Join the world?s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
Message #2 by "zak willis" <zak@z...> on Tue, 20 Aug 2002 15:23:06
|
|
I think you are approaching it in the wrong way.
1. Your approach does not sound very good, as imagine if someone typed in
Administrator, yet they were a guest.
Assuming you have set up a workgroup information file with security
groups, why not access the DAO current_user property, from within a
start_up form code? From that information, you can then go about changing
the menu depending upon the user. If you really want to have a password
box then you must look at the properties of the textbox, and in the input
mask property, type in the word, password. You then get the common
asterixes that exist with all password boxes.
2. Why would you want to display a message box showing the number of
records found, when it clearly says so on the filter property/record count
of the form? Message boxes are annoying and should be avoided. You could
access the same query filter on the table using dao or ADO, and then pass
the recordcount property to the form or message box if desired.
> I have two (2) problems and hope someone can show me the sunshine.
Situation #1:
I have two (2) main menus. One is for administration & the other is for
Guests. When the user types in "Guest" the Guest Main Menu would display.
Question:
1. What is the procedure to create a USER/LOGIN box? (just like how when
one
has to type in USERNAME & Password in email).
Situation #2:
I have created a SEARCH FORM. When a search is done, and the database
have
found 3 records, the confirmation box displays "Record Found."
Question:
2. I would like the msg to display "3 Records Found" or "0 Record
found."
How do I do a Record Counter(?) I'm not sure if that's the correct
definition.
Any help is greatly appreciated!
Rick
_________________________________________________________________
Join the world?s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
Message #3 by "Steven White" <Steve.White@m...> on Tue, 20 Aug 2002 23:39:43
|
|
I agree with Zak - CurrentUser() is a better way to go. If you're only having the two accounts,
or if you plan on adding more users in an ad hoc way, there's no problem with it. Basically, you
just need a little procedure on a startup form's onLoad event which goes something like
Dim CUser as String
CUser = CurrentUser()
If CUser = Administrator Then
DoCmd.OpenForm "AdminForm"
Else
DoCmd.OpenForm "GuestForm"
End If
You'll probably also want an event which closes that startup form (DoCmd.Close "startup") on
each of those other forms.
Or, if the two forms are similar, you could have it so that it changes the Visibility of some
objects depending on the user
eg:
If CUser = Administrator Then
cmdAdminStuff.Visible = True
cmdSomethingElse.Visible = True
Else
Message #4 by "Rick N" <loonievisa@h...> on Tue, 20 Aug 2002 16:53:13 -0600
|
|
Hi Steve,
Do I start on a new Event Procedure or do I go into the switchboard to add
on those code that you suggested? Sorry, I'm new at this so bare with the
yokel questions.
I'm attaching my database for you to see. It was done is MS Access 2000.
>From: "Steven White" <Steve.White@m...>
>Reply-To: "Access" <access@p...>
>To: "Access" <access@p...>
>Subject: [access] Re: Creation of USER/LOGIN Box & RECORD COUNTER
>Date: Tue, 20 Aug 2002 23:39:43
>
>I agree with Zak - CurrentUser() is a better way to go. If you're only
>having the two accounts,
>or if you plan on adding more users in an ad hoc way, there's no problem
>with it. Basically, you
>just need a little procedure on a startup form's onLoad event which goes
>something like
>
>Dim CUser as String
>CUser = CurrentUser()
>If CUser = Administrator Then
> DoCmd.OpenForm "AdminForm"
>Else
> DoCmd.OpenForm "GuestForm"
>End If
>
>You'll probably also want an event which closes that startup form
>(DoCmd.Close "startup") on
>each of those other forms.
>
>Or, if the two forms are similar, you could have it so that it changes the
>Visibility of some
>objects depending on the user
>
>eg:
>
>If CUser = Administrator Then
> cmdAdminStuff.Visible = True
> cmdSomethingElse.Visible = True
>Else
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
Message #5 by John Fejsa <John.Fejsa@h...> on Wed, 21 Aug 2002 09:46:02 +1000
|
|
You do have a password for each account as well, do you?
Without a password protection any user could just type in administrator to get to administrator form
____________________________________________________
John Fejsa
Systems Analyst/Computer Programmer
Hunter Centre for Health Advancement
Locked Bag 10, WALLSEND NSW 2287
Phone: (02) 4924 6336 Fax: (02) 4924 6209
www.hcha.org.au
____________________________________________________
The doors we open and close each day decide the lives we live
____________________________________________________
CONFIDENTIALITY & PRIVILEGE NOTICE
The information contained in this email message is intended for the named addressee only. If you are not the intended recipient you
must not copy, distribute, take any action reliant on, or disclose any details of the information in this email to any other person
or organisation. If you have received this email in error please notify us immediately.
>>> Steve.White@m... 21/08/2002 9:39:43 >>>
I agree with Zak - CurrentUser() is a better way to go. If you're only having the two accounts,
or if you plan on adding more users in an ad hoc way, there's no problem with it. Basically, you
just need a little procedure on a startup form's onLoad event which goes something like
Dim CUser as String
CUser = CurrentUser()
If CUser = Administrator Then
DoCmd.OpenForm "AdminForm"
Else
DoCmd.OpenForm "GuestForm"
End If
You'll probably also want an event which closes that startup form (DoCmd.Close "startup") on
each of those other forms.
Or, if the two forms are similar, you could have it so that it changes the Visibility of some
objects depending on the user
eg:
If CUser = Administrator Then
cmdAdminStuff.Visible = True
cmdSomethingElse.Visible = True
Else
|
|
 |