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
|
|||
|
|||
Stop at last record
I have a form that uses navigation buttons for the user to view all the
records. When they reach the last record and select next a blank record appears. As I have some calculations that occur when the form loads this results in the auto-number generating a new record in the table. If the user didn't want to create a new record and leave the form I am left with a redundant record in the table. I have another button which utilises carry over code for new records so I want the user to only use that for new records. How do I force at "stop" at the last record? |
#2
|
|||
|
|||
"New TO Access" wrote in
message I have a form that uses navigation buttons for the user to view all the records. When they reach the last record and select next a blank record appears. As I have some calculations that occur when the form loads this results in the auto-number generating a new record in the table. If the user didn't want to create a new record and leave the form I am left with a redundant record in the table. I have another button which utilises carry over code for new records so I want the user to only use that for new records. How do I force at "stop" at the last record? If you set the form's AllowAdditions property to No, the user won't be able to navigate to a new record. If your navigation buttons are not the builtin ones, you may have to modify the code behind the "next record" button to trap and ignore an error that may be raised when the code tries to go to the next record. Naturallky, since I can't see the code, I can't tell you exactly what changes you may have to make. An alternative is to have code in the form's Current event to disable or enable the "next record" button depending on whether you are on the last record or not. Your "new record" button may need to temporarily set the AllowAdditions property to Yes before you go to the new record, in which case you'll need code in some event -- maybe the form's AfterInsert event -- to set it back to No again. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#3
|
|||
|
|||
On Mon, 17 Jan 2005 12:13:01 -0800, "New TO Access"
wrote: How do I force at "stop" at the last record? Set the Form's AllowAdditions property to No. If you want to add records, you can change this property when needed, or add the record to the table in code. John W. Vinson[MVP] |
#4
|
|||
|
|||
Thanks folks. The allow additions worked really well!
"John Vinson" wrote: On Mon, 17 Jan 2005 12:13:01 -0800, "New TO Access" wrote: How do I force at "stop" at the last record? Set the Form's AllowAdditions property to No. If you want to add records, you can change this property when needed, or add the record to the table in code. John W. Vinson[MVP] |
#5
|
|||
|
|||
I have faced the same problem and got the fix here (from you, I think). It
worked as advertises, but now does not. What could I have done to mess this up? Thanks "John Vinson" wrote: On Mon, 17 Jan 2005 12:13:01 -0800, "New TO Access" wrote: How do I force at "stop" at the last record? Set the Form's AllowAdditions property to No. If you want to add records, you can change this property when needed, or add the record to the table in code. John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Prevent Blank Records being written. Need Help. | Robert Nusz @ DPS | Using Forms | 4 | December 29th, 2004 05:15 PM |
Automatically displaying a certain record of a query | General Discussion | 1 | December 12th, 2004 10:08 PM | |
How to get a field on a form to reflect a certain record of a query? | General Discussion | 0 | December 11th, 2004 12:56 AM | |
Stop page breaks within a record. | Marc | Mailmerge | 0 | September 24th, 2004 02:52 PM |
Form Does Not Go To New Record | Steve | New Users | 1 | May 12th, 2004 03:15 AM |