Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default prompt for password only once

I have a database I set up in Excel to track certain information on the
stores we service. I created a userform to allow the addition of new
stores as they come online to simplify the matter. I password protected
the userform, which is working fine...but I would like it so that once you
enter the password correctly, you will not be prompted for it again as long
as the workbook is open. The issue is that as you are adding info to the
database, you might come to a point where you have to add a store to the
database. So you open the userform...in order to do this you are first
prompted to enter the correct password. This is fine if the only occurs
once, but if you have to do it several times while adding data, it gets old
in a hurry. I can't seem to figure out how to do this. I am not a vba
newbie, but I am no expert by any means. Any help would be greatly
appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default prompt for password only once

This seems too simple so I think I might be missing something. Can you not
just test the user's entry against the correct password and if it matches
then change a public variable from its default value to whatever? Say it's
Boolean, change it from the default value of False to True (e.g. name it
"UserAuthorized" and change it from False to True). Henceforth, so long as
it's True then don't require password entry. Once the WB is closed memory is
lost and it reverts to False on reopen.

Regards,
Greg Wilson

"Mike Boynton via OfficeKB.com" wrote:

I have a database I set up in Excel to track certain information on the
stores we service. I created a userform to allow the addition of new
stores as they come online to simplify the matter. I password protected
the userform, which is working fine...but I would like it so that once you
enter the password correctly, you will not be prompted for it again as long
as the workbook is open. The issue is that as you are adding info to the
database, you might come to a point where you have to add a store to the
database. So you open the userform...in order to do this you are first
prompted to enter the correct password. This is fine if the only occurs
once, but if you have to do it several times while adding data, it gets old
in a hurry. I can't seem to figure out how to do this. I am not a vba
newbie, but I am no expert by any means. Any help would be greatly
appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default prompt for password only once

Thats what I have been trying to do. I put a watch on the variable and it
does toggle to true, but when the code finishes and it exits the sub, the
variable looses it value. I can't seem to figure out what I am doing
wrong. Maybe I need to bring this home instead of trying to work on it in
my spare time at work.

--
Message posted via http://www.officekb.com
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default prompt for password only once

Put it in a General module:
Public UserAuthorized as boolean

It may help.

"Mike Boynton via OfficeKB.com" wrote:

Thats what I have been trying to do. I put a watch on the variable and it
does toggle to true, but when the code finishes and it exits the sub, the
variable looses it value. I can't seem to figure out what I am doing
wrong. Maybe I need to bring this home instead of trying to work on it in
my spare time at work.

--
Message posted via http://www.officekb.com


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default prompt for password only once

Thanks for the tip Dave, that did it! I had it in a sub under the
worksheet.

--
Message posted via http://www.officekb.com


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
msquery prompt for password jocke Excel Discussion (Misc queries) 3 March 17th 06 09:07 PM
Password Prompt Noel Excel Discussion (Misc queries) 0 May 18th 05 07:42 PM
Password Prompt LuhElle Excel Discussion (Misc queries) 1 March 8th 05 11:11 PM
Prompt for VBAproject password Eric van Uden[_2_] Excel Programming 11 January 16th 05 01:56 PM
DSN UserId and Password Prompt bslater[_12_] Excel Programming 1 September 22nd 04 08:30 PM


All times are GMT +1. The time now is 10:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"