Results 1 to 6 of 6
  1. #1
    Tobold is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    3

    Constant not allowed as Public Member of Object Modules

    Novice Access user here...

    Watching Steve Bishop's videos on YouTube on hashing passwords.
    https://www.youtube.com/watch?v=x4FA...V737s&index=60

    Steve puts this statement in the General / Declaration Section of the code about 4 min and 30 sec into the video.
    Public Const Salt As Long = 543211234



    When I do this, I get an error that says:
    "Compile Error: Constants, fixed-length strings, user-defined types and Declare statements not allowed as Public members of object modules."

    Videos are for Access 2013, I am using Access 2007-2016 file format.

    How do I get this to work? Thanks,

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    That line needs to be in a standard module, not behind a form or report. Is it's?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Tobold is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    3
    Okay, so i just create a new module and put it there?
    I can look at some of the other related posts as well.
    Thanks,

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    That should work, yes. Post back if you're still stuck.

    welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Tobold is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    3

    Globals Module

    That worked. Now I see the difference in the Class Modules and the Other Modules and the two separate folders with one folder for each module type (class modules vs the other modules). When I watched the video again I could see where he even mentioned putting it in the Globals module and the Globals module was highlighted. Now I understand that when it says I cannot put it in a class module what that means. Self taught novice here for sure. Good to see the connections piece by piece.

    Thanks,

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 10-16-2019, 03:45 PM
  2. Filelen (a member of the FileSystem object)
    By GraeagleBill in forum Programming
    Replies: 9
    Last Post: 07-24-2017, 03:31 PM
  3. When to use standard modules vs. class modules
    By Access_Novice in forum Programming
    Replies: 7
    Last Post: 01-03-2016, 10:47 PM
  4. Modules and Object Overload
    By drexasaurus in forum Programming
    Replies: 4
    Last Post: 05-23-2014, 11:14 AM
  5. Replies: 3
    Last Post: 05-21-2014, 10:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums