Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    10,015
    Thanks
    429
    Thanked 1,611 Times in 1,460 Posts
    Zeddy,

    Not the place I'd recommend placing passwords.
    HidePWD.JPG
    Easier to find here than in the VBA as you can hide the project and password protect that or you could put them on a hidden & protected sheet.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  2. #17
    New Lounger
    Join Date
    Jun 2015
    Posts
    23
    Thanks
    3
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by zeddy View Post
    Hi erfan

    if you add a zero it will 'coerce' a textbox entry to be numeric..
    e.g. Me.Txt_Inv_Amount + 0

    I have included this in the attached updated example file.

    I have placed buttons on the [SwitchBoard] sheet.


    No, you don't have much choice with the Excel built-in DataForm (it has a max of 32 data fields).
    But you have discovered that you can 'disable' some of the fields displayed in the DataForm i.e. prevent changes in certain fields, by 'locking' the relevant corresponding data columns and protecting the data-records-worksheet.

    The big advantage of using the Excel built-in DataForm is that it comes with a very good 'search' mode where you can use wildcard characters in the DataForm's fields..
    e.g. sm?th finds "smith" and "smyth", *east finds "Northeast" and "Southeast", * finds records where that field is non-blank etc etc etc

    NOTES:
    These new buttons will require a password to be entered.
    Each button uses a different password.

    Rather than put the actual passwords directly into the vba code, I have placed them in the cells underneath the buttons i.e. in cells [G10], [G12] and [G15], and use vba to 'fetch' these cell values.

    The prompt for a password uses a new UserForm I have added (rather than using a simple InputBox method).
    This allows us to hide the characters entered by the User, by using the Userform's textbox PasswordChar property (which I have set to an asterisk * )

    I have commented the vba code so you can follow what is going on.

    Now, remember, we are here to help you and answer your questions, but are not supposed to do all the work for you!

    ..the password for [Edit Existing Records] is zzzDATA
    ..the password for [ADD New Record] is zzzADD
    ..the password for [Edit Cheque Details] is zzzAHMAD

    zeddy
    Dear Zeddy !

    A bundle of Thanks, Thank you for helping me out; I really appreciate your kindness and support.

  3. The Following User Says Thank You to erfan For This Useful Post:

    zeddy (2018-10-17)

  4. #18
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    3,318
    Thanks
    164
    Thanked 624 Times in 593 Posts
    Hi erfan

    Thanks for your appreciation - kindness makes a difference.

    zeddy

  5. #19
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    3,318
    Thanks
    164
    Thanked 624 Times in 593 Posts
    Hi RG

    Now tell me you only found that zzzDATA because I told everyone where it was!

    I agree with you, but this is a training exercise for erfan. It's one step at a time!

    Now I could've formatted those cells with the ;;; custom format, so you wouldn't have seen them in the formula bar! And I tried not to mention the word "password" anywhere for those cells (to rule out the usual search-and-find methods).

    In the real world, there are many methods we can use to protect our creative masterpieces from User abuse!
    One of my favoured methods is to use trigger files to open camouflaged Excel files, using the login ID to identify the User and restrict what that particular User is allowed to do. For additional password control I use easily-remembered algorithms which dynamically change access passwords based on the system clock (i.e. they change hourly and disable access after working-hours, weekends, holidays etc etc etc)

    Now, more importantly than all this stuff, how are you managing with all that bad-weather I see reported around your neck of the woods. Have you anchored your RV safely? Did you need to use your canoes?? Are you stocked up with provisions??? (I keep 50 cans of beans in my emergency larder - I love beans me)

    zeddy

  6. #20
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    10,015
    Thanks
    429
    Thanked 1,611 Times in 1,460 Posts
    Zeddy,

    We lucked out with the weather only a lot of rain, which we are used to, and a little wind. Nothing major in our area. My brother who lives in Wilmington, N.C. however got plastered!

    As for the passwords, yes you told us where they were but casually moving around the sheet with the cursor keys would quickly reveal them and IMHO anyone trying to crack in would do obvious stuff like that. I prefer to include the PWs in the code and then lock the code down in the VB Editor so it cant be viewed and use a long password to do it. Also I agree locking access based on User Accounts is an Excellent way to go as I use it often. Of course a determined hacker will even get around the locking up of the code but that does take a modicum of knowledge.

    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  7. #21
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    3,318
    Thanks
    164
    Thanked 624 Times in 593 Posts
    Hi RG

    Now I could've formatted those cells with the ;;; custom format, so you wouldn't have seen them in the formula bar!
    Naturally, we cannot tell everyone how to properly protect stuff, otherwise they'll come back to us to tell them how to 'unprotect' stuff when they forget what they did.

    zeddy
    PS I am aiming to get plastered this weekend. Drunk as a Lord in fact. meeting up with some long lost friends

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •