Need help with Forms

mpasta

New member
Local time
Today, 10:23
Joined
Dec 12, 2024
Messages
10
Good morning! I am creating a Form for the first time to use with our database as a way to enter new members. Is there a way to have the form always open to a new record instead of opening with data already there from the table?
 
Welcome to Access World! We're so happy to have you join us as a member of our community. As the most active Microsoft Access discussion forum on the internet, with posts dating back more than 20 years, we have a wealth of knowledge and experience to share with you.

We're a friendly and helpful community, so don't hesitate to ask any questions you have or share your own experiences with Access. We're here to support you and help you get the most out of this powerful database program.

To get started, we recommend reading the post linked below. It contains important information for all new users of the forum:

https://www.access-programmers.co.uk/forums/threads/new-member-read-me-first.223250/

We hope you have a great time participating in the discussion and learning from other Access enthusiasts. We look forward to having you around!
 
Yes, set Data Entry to Yes.
Not what I would recommend though.
 
Good morning! I am creating a Form for the first time to use with our database as a way to enter new members. Is there a way to have the form always open to a new record instead of opening with data already there from the table?
Using the form On Load Procedure Event enter the following line of code:
DoCmd.GoToRecord acActiveDataObject, , acNewRec
 
I should have mentioned I am quite the novice in Access. I am using the wizards to create most of this...
 
why don't you recommend this?
Because it would drive me around the bend if every time I opened a form it meant I had to add a record.
I would have a form that allowed me to read/edit and add records. Not one to add and another to read/edit.

If you create a form to do all three, then there are navigation buttons as the bottom and the * allows you to create a new record. I have always used the Access native functionality when possible. My users never complained. :-)
 
Last edited:
Can you describe the overall purpose of this ACCESS application and what you want to keep track of with it? The building of the table design comes first, before anything else, including building forms and reports.
 
The OpenForm method has arguments FOR EXACTLY THIS REASON. Once you understand the purpose of the arguments, you can use the OpenForm method to open the form in the mode that you want to open it. You can have multiple menu items for example. click on option 1 to always add. Click on option 2 to always edit. No If's. Just two slightly different OpenForm commands.

As you can tell. I never use Larry's suggested method either.
 
Can you describe the overall purpose of this ACCESS application and what you want to keep track of with it? The building of the table design comes first, before anything else, including building forms and reports.
I have the table built. It is a table to store our student data. The form would only be used to add new students; not for any other purpose which is why I would like it to open with a blank record each time so that our users never accidentally type over a current student's data
 
I have the table built. It is a table to store our student data. The form would only be used to add new students; not for any other purpose which is why I would like it to open with a blank record each time so that our users never accidentally type over a current student's data
I must agree with Gasman's suggested method.
 
Then when the logic changes in the Add form, you need to apply the same to the Edit form?
 
The form would only be used to add new students; not for any other purpose which is why I would like it to open with a blank record each time so that our users never accidentally type over a current student's data
What does your user do if after entering a new student they realize they made a typo? Or entered a duplicate student?
Why have 2 forms when one will suffice? There's a reason Microsoft included the DataMode argument in the open form method.

There are many ways to idiot proof forms. Here's my example from above but I added a button that Unlocks or locks a form from accidentally being edited.
 

Attachments

Because it would drive me around the bend if every time I opened a form it meant I had to add a record.
I would have a form that allowed me to read/edit and add records. Not one to add and another to read/edit.

If you create a form to do all three, then there are navigation buttons as the bottom and the * allows you to create a new record. I have always used the Access native functionality when possible. My users never complained. :-)

However there is one scenario where separating them is a good idea: Where the job function of the end-users differs by the same category separating the forms. (which mine usually have-one person doing heads down data entry and another , maybe one manager, who has the authority to edit).
 
However there is one scenario where separating them is a good idea: Where the job function of the end-users differs by the same category separating the forms. (which mine usually have-one person doing heads down data entry and another , maybe one manager, who has the authority to edit).
That can also be coded into the single form with user levels.
 
Good morning! I am creating a Form for the first time to use with our database as a way to enter new members. Is there a way to have the form always open to a new record instead of opening with data already there from the table?
Hi. Welcome to AWF!

Were you able to solve your issue? Did you try any of the suggestions?
 
That can also be coded into the single form with user levels.
Of course that's true, I just like the design of my system to reflect the business processes and decision making in the real world
 
The form would only be used to add new students; not for any other purpose which is why I would like it to open with a blank record each time so that our users never accidentally type over a current student's data
That would mean that you would need a second, more or less duplicate form that is only used to edit existing records. In order to not open to the "first" record in the recordset, the form that opens this edit form would have to include a search feature so the user could choose the record he wants to edit BEFORE the edit form opens. This also means that you need to duplicate all the validation code in both form and we all know where that leads.

A better solution is to learn how to control the form so it doesn't open to some arbitrary record. For example, most of my edit forms have simple search criteria. One or two fields. If they need more complex search capabilities, I create specialized search forms that if the search returns a single record, open the edit form directly to the selected record but if the search returns multiple records, a list form is opened and the user can do more searching or scroll to the record he wants and double clicking on any record opens the edit form to the selected record. To make this work, the edit form is bound to a query that uses criteria that references the edit form's search fields. That means that opening the edit form always brings up an empty form so it is ready to add. If the user knows what he wants to view, he enters his search criteria and presses the find button. There are other methods. Some people add an edit button to the form so the form always opens "locked". They can use the search criteria and then when they find the record they want, they press the edit button to unlock the record. I'm sure a poll would reveal at least 2 or 3 other common solutions. No expert would willingly create separate forms for add and edit.
 

Users who are viewing this thread

Back
Top Bottom