Results 1 to 14 of 14
  1. #1
    Vita's Avatar
    Vita is offline Competent Performer
    Windows 10 Access 2002
    Join Date
    May 2022
    Location
    Massachusetts, USA
    Posts
    296

    Startup Form in DB Options vs in Autoexec

    I have noticed that some people use Autoexec to open their main navigation form instead of the default form option in the DB settings.
    What are the pros and cons of using each option?


    I know you can use Autoexec for more than opening the form so that can be a pro but is there a reason why you wouldn't set the default form in the DB options and then use autoexec for other things?
    Does one open before the other?

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    This should answer some of your question.
    Attached Files Attached Files
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Expanding on moke's example, see https://isladogs.co.uk/autoexec-myths/index.html
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  4. #4
    Vita's Avatar
    Vita is offline Competent Performer
    Windows 10 Access 2002
    Join Date
    May 2022
    Location
    Massachusetts, USA
    Posts
    296
    Quote Originally Posted by moke123 View Post
    This should answer some of your question.
    Ah so the DB form setting loads the form first.
    I wonder if there are any other pros or cons. Probably not.
    Thanks!

  5. #5
    Vita's Avatar
    Vita is offline Competent Performer
    Windows 10 Access 2002
    Join Date
    May 2022
    Location
    Massachusetts, USA
    Posts
    296
    Quote Originally Posted by isladogs View Post
    Expanding on moke's example, see https://isladogs.co.uk/autoexec-myths/index.html
    Oh! This is great information! Thank you!

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Looks to me like the best method is to use autoexec to run code (run code is not in the unsafe list) and that's all.
    It's what I've done for many years now. I've never worked in or for a place that allowed shared Windows logins, so I didn't use password management. Instead I looked up the user's Windows login id in a table. Not there? Not getting in. The autoexec ran that code.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Vita's Avatar
    Vita is offline Competent Performer
    Windows 10 Access 2002
    Join Date
    May 2022
    Location
    Massachusetts, USA
    Posts
    296
    Quote Originally Posted by Micron View Post
    Looks to me like the best method is to use autoexec to run code (run code is not in the unsafe list) and that's all.
    It's what I've done for many years now. I've never worked in or for a place that allowed shared Windows logins, so I didn't use password management. Instead I looked up the user's Windows login id in a table. Not there? Not getting in. The autoexec ran that code.
    Speaking of password management. What would you recommend as the best kind of security for an Access DB? Currently I have an old DB that uses user level security but I learned that can be a headache to remove.
    I need 3 levels of users essentially. Regular users, Data Entry users, and Admins. I want to make it into an MDE too since the older version is just an MDB with user level security.

  8. #8
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Old security using mdw file? Can't be used in upgraded versions AFAIK. I'd probably import all objects into a new accdb and start over. Methinks a user table with a UserLevel field (PK values from tblLevels) is the way to go.tblLevels Level field values would be numeric, but not 1,2,3 ... more like 2,4,6 (or some larger progression). Level titles (e.g. UserRO, UserEdit or less flexible as in User, Supervision, Admin - whatever works) with the least rights having the lowest number. When opening a form, it's easy to use comparison operators such as >, <, = to control permissions for forms/reports. You might allow additions where level is greater than 2 (read only) but less than 6 because admins can administer but not play with data - stuff like that.

    Security is a large topic. You should visit site via post 3 link and look for info.

    EDIT - not 1,2,3 because with values like 3,6,9 you will be able to insert new levels without having to move things around if new levels fit somewhere between the min and max.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    Vita's Avatar
    Vita is offline Competent Performer
    Windows 10 Access 2002
    Join Date
    May 2022
    Location
    Massachusetts, USA
    Posts
    296
    Quote Originally Posted by Micron View Post
    Old security using mdw file? Can't be used in upgraded versions AFAIK. I'd probably import all objects into a new accdb and start over. Methinks a user table with a UserLevel field (PK values from tblLevels) is the way to go.tblLevels Level field values would be numeric, but not 1,2,3 ... more like 2,4,6 (or some larger progression). Level titles (e.g. UserRO, UserEdit or less flexible as in User, Supervision, Admin - whatever works) with the least rights having the lowest number. When opening a form, it's easy to use comparison operators such as >, <, = to control permissions for forms/reports. You might allow additions where level is greater than 2 (read only) but less than 6 because admins can administer but not play with data - stuff like that.

    Security is a large topic. You should visit site via post 3 link and look for info.

    EDIT - not 1,2,3 because with values like 3,6,9 you will be able to insert new levels without having to move things around if new levels fit somewhere between the min and max.
    Yea I couldn't upgrade it but whatever I make will need to be backwards compatible with Access 2000 so it wont be a accdb. I think I get what you're saying but wouldn't that be writing a lot of extra comparisons into functions?
    Maybe it would be better on login to set a global variable true and check if that variable is true elsewhere. Even then it seems like a lot more work than the built in user level security. I don't need anything super complicated just a simple read only, read and write, and admin aka read write and edit. Its for an inventory tool so most users will just use it to search inventory but there is the entry team that needs to add or remove inventory. Then there's admins such as myself.

    Would it make sense to just develop the database and then as a last step, clone it, add the built in user level security, and then make it into a MDE?

    3rd post link as in Isladogs website?

  10. #10
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    There are a lot of security related articles on my website.
    Use the Site Search feature: Website Search (isladogs.co.uk)
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  11. #11
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    whatever I make will need to be backwards compatible with Access 2000
    Why is that if you were to import tables into e.g. a 365 back end and the rest into a 365 front end? Yes, you'd have to replace what the mdw did with code.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  12. #12
    Vita's Avatar
    Vita is offline Competent Performer
    Windows 10 Access 2002
    Join Date
    May 2022
    Location
    Massachusetts, USA
    Posts
    296
    Quote Originally Posted by isladogs View Post
    There are a lot of security related articles on my website.
    Use the Site Search feature: Website Search (isladogs.co.uk)
    I will check it out. I need to spend more time on your site. Thanks for putting so much effort into teaching materials!

  13. #13
    Vita's Avatar
    Vita is offline Competent Performer
    Windows 10 Access 2002
    Join Date
    May 2022
    Location
    Massachusetts, USA
    Posts
    296
    Quote Originally Posted by Micron View Post
    Why is that if you were to import tables into e.g. a 365 back end and the rest into a 365 front end? Yes, you'd have to replace what the mdw did with code.
    Half our company still has Access 2000 so my boss requested it. It part of the agreement so that I get to update it from the mess that it is now.

  14. #14
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Quote Originally Posted by Vita View Post
    I will check it out. I need to spend more time on your site. Thanks for putting so much effort into teaching materials!
    You're welcome. Several new or updated articles are added each week
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Autoexec into a form from start up
    By Grumpy Ump in forum Access
    Replies: 2
    Last Post: 10-11-2019, 09:09 AM
  2. autoexec to execute function at startup not working
    By bbxrider in forum Programming
    Replies: 10
    Last Post: 01-12-2019, 05:50 PM
  3. Replies: 3
    Last Post: 06-24-2010, 07:18 PM
  4. Access 2000 programming startup options
    By nosaj_ccfc in forum Programming
    Replies: 2
    Last Post: 10-17-2008, 02:18 PM
  5. Bypassing Startup options with Ctrl W
    By rayc in forum Security
    Replies: 0
    Last Post: 09-06-2006, 09:18 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