Forum Discussion
Access 2010 to professional plus 2019
I have a form that has a control button at the bottom which takes you to the next record for the individual customer, when the next form loads it starts at the bottom of the form (as my form is quite long) I have checked tab order but don't know what else to try, VBA is not something I understand much but have managed to add some from watching utube videos.
Question 2 can I password protect a form so prevent it being closed as I've made it a main menu. If you can help I would need an access for dummies step by step guide through it lol
Hi
1. Just to be clear, you want the form to open at the first record not the last. Normally, that would happen anyway unless your code is preventing it. However you could add this line to the Form_Load event: DoCmd.GoToRecord , , acFirst
2. It is certainly possible to password protect a form (or report) though I've only ever done this to make users enter a password before opening a form with confidential data. I'm not sure why you would add a password to prevent the form being closed. Why not just remove the close button in the title bar or prevent the form being closed until certain actions have been performed? At some point the form will have to be closed anyway.
Do bear in mind that keyboard shortcuts such as Ctr+F4 can be used to forcibly close forms & indeed Alt+F4 closes the database itself. See https://support.microsoft.com/en-us/office/keyboard-shortcuts-for-access-70a673e4-4f7b-4300-b8e5-3320fa6606e2
Suggest you explain your purpose more clearly.
- Yvonnebatfink406Oct 20, 2021Copper ContributorThanks for the reply, I have created a database for us girls in an office, I have limited knowledge of database, ecdl advance level, at the moment we are using a spreadsheet to list the customers and their details when visited, each time they come in another line is added to the spreadsheet which isn't the best idea, I have created a database with basically 2 tables, one for the customers details ie name etc and another table for each visit. These r joined by customer ID in relationship. I have a form which is the main navigation for moving around different queries and to find each customer record,. when I have entered a customers details on a form I created, a form I created for the second table for their visit info loads, this is quite a long form, at the end of this form I have a button that opens up a new record for their next visit. It's always opening up at the bottom of the new blank form instead of at the top, I have tried tab order but not helped. I have worked how to stop the main form from being closed by saying no in the properties so that's sorted as if the girls accidently closed the main form, opening it again in the navigation pane would confuse them. If I could just get it to scroll to the top when a new customer visit is added would finish it off. I am amazed I've got my database and queries to actually work consistently in the first place and now just looking at the finishing touches
- George_HepworthOct 20, 2021Silver Contributor
Yvonnebatfink406 "... It's always opening up at the bottom of the new blank form instead of at the top, "
That is by design the way forms work. It's theoretically possible, I believe, to force a different behavior, but it's probably the path of least resistance to train your users to work with the default behavior.
The analogy I like to share is that using Access is somewhat like rowing a canoe. If you are trying to go upstream, against the basic design patterns of the software, you'll have to work a lot harder, i.e. paddle your canoe ferociously, to make any progress. If you go downstream, with the basic design patterns of the software, you only need to use the paddle to steer.
To paraphrase the old saying, "go with the flow or paddle like crazy to get anywhere."
- Yvonnebatfink406Oct 20, 2021Copper ContributorI like it lol