If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
OPen form to new record
I have a data entry form for my database and want it to open up at a new
record each time I open it. I'm sure I had an example of this filed away on my PC somewhere but I can't find it! Can someone remind me please? Regards, Gavin |
#2
|
|||
|
|||
OPen form to new record
gavin wrote:
I have a data entry form for my database and want it to open up at a new record each time I open it. I'm sure I had an example of this filed away on my PC somewhere but I can't find it! Can someone remind me please? Set the DataEntry property of the form to Yes. -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
#3
|
|||
|
|||
OPen form to new record
"Rick Brandt" wrote in message . com... gavin wrote: I have a data entry form for my database and want it to open up at a new record each time I open it. I'm sure I had an example of this filed away on my PC somewhere but I can't find it! Can someone remind me please? Set the DataEntry property of the form to Yes. Is it really that simple? I hang my head in shame :-( Thanks very much, Rick! Gavin |
#4
|
|||
|
|||
OPen form to new record
In addition to what Rick wrote, if you want to open it to a new record but
be able to view/edit other records through this form as opposed to using it strictly for data entry, then you'll want a slightly different approach. Set its DataEntry property to No. In those instance where you want to open it in DataEntry mode, specify it in the DoCmd statement DoCmd.OpenForm "MyForm ,,,,acFormAdd Otherwise, you can use the following to take you to a new record, but allow you to view and edit existing records: DoCmd.OpenForm "MyForm" DoCmd.GoToRecord ,, acNewRec Brian "gavin" wrote in message ... "Rick Brandt" wrote in message . com... gavin wrote: I have a data entry form for my database and want it to open up at a new record each time I open it. I'm sure I had an example of this filed away on my PC somewhere but I can't find it! Can someone remind me please? Set the DataEntry property of the form to Yes. Is it really that simple? I hang my head in shame :-( Thanks very much, Rick! Gavin |
#5
|
|||
|
|||
OPen form to new record
"Brian Bastl" wrote in message ... In addition to what Rick wrote, if you want to open it to a new record but be able to view/edit other records through this form as opposed to using it strictly for data entry, then you'll want a slightly different approach. Set its DataEntry property to No. In those instance where you want to open it in DataEntry mode, specify it in the DoCmd statement DoCmd.OpenForm "MyForm ,,,,acFormAdd Otherwise, you can use the following to take you to a new record, but allow you to view and edit existing records: DoCmd.OpenForm "MyForm" DoCmd.GoToRecord ,, acNewRec Brian Hi Brian, Thanks for the reply - I'm not very experienced with VBA - where do I put this code? Regards, Gavin |
#6
|
|||
|
|||
OPen form to new record
1. Open form in design view
2. Right-click on its title bar 3. Select Properties to open the form's property sheet If you only want to use the form for data entry and not for editing, then click the "All" tab and then find the line for Data Entry. Change this from No to Yes. If you always want to begin at a new record but also allow existing records to be view and edited in the same form instance, then you have two options. ****************************************** Option 1 (not always the best approach): follow steps 4 thru 10. 4. Click on the "Events" tab 5. Click on the words "On Load" 6. Directly to the right, click the down arrow and select [Event Procedure] 7. Directly to the right of that, there will be a button which looks like [...] 8. Click it to open the vba editor 9. You'll now see some text which looks like the following: Private Sub Form_Load() End Sub On a blank line between those two, you'd type: DoCmd.GoToRecord ,, acNewRec 10. Click the "Save" button and then on the application's menu bar, go to Debug | Compile. If you get no errors, close the editor, and then the form. Then re-open the form normally to see if it works like you want. **************************************** Option 2 uses a command button on another form: Follow steps 1 - 3, but obviously opening a different form Add a command button by clicking on the toolbox Follow the Wizard dialogue When finished, right click the new command button and click "Build" to open the vba editor. On a blank line directly following "DoCmd.OpenForm ..... type: DoCmd.GoToRecord ,, acNewRec See #10 above ******************************************* HTH, Brian "gavin" wrote in message ... "Brian Bastl" wrote in message ... In addition to what Rick wrote, if you want to open it to a new record but be able to view/edit other records through this form as opposed to using it strictly for data entry, then you'll want a slightly different approach. Set its DataEntry property to No. In those instance where you want to open it in DataEntry mode, specify it in the DoCmd statement DoCmd.OpenForm "MyForm ,,,,acFormAdd Otherwise, you can use the following to take you to a new record, but allow you to view and edit existing records: DoCmd.OpenForm "MyForm" DoCmd.GoToRecord ,, acNewRec Brian Hi Brian, Thanks for the reply - I'm not very experienced with VBA - where do I put this code? Regards, Gavin |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Parameter thru Form Dialog Box for REPORT | Sandy | Setting Up & Running Reports | 16 | January 10th, 2006 10:06 AM |
Form won't open report from preview button | jwr | Using Forms | 5 | October 29th, 2005 04:53 PM |
Open form to specific record | Madmax via AccessMonster.com | Using Forms | 7 | September 29th, 2005 06:53 AM |
Need Help In Printing Current Record in Specific Report | RNUSZ@OKDPS | Setting Up & Running Reports | 1 | May 16th, 2005 09:06 PM |
Form drops edited record-inserts new record instead | karenk10 | General Discussion | 0 | September 22nd, 2004 10:19 PM |