A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Stop advancing in form with the "next" arrow at end of "list"



 
 
Thread Tools Display Modes
  #1  
Old March 3rd, 2010, 07:24 PM posted to microsoft.public.access.forms
Duchess
external usenet poster
 
Posts: 9
Default Stop advancing in form with the "next" arrow at end of "list"

I have an editable form for users where they can query by date, etc.
However, the next entry arrow allows them to advance beyond the result. For
example, if their query resulted in 1 of 4, they can still click to 5, 6, and
so on which only adds blank lines to the database table. How do I set this
to stop at the last entry of their original query?
  #2  
Old March 3rd, 2010, 08:01 PM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Stop advancing in form with the "next" arrow at end of "list"

You can cancel adding new records like this:

Private Sub Form_BeforeInsert(Cancel As Integer)
Cancel = True
End Sub


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Duchess" wrote in message
...
I have an editable form for users where they can query by date, etc.
However, the next entry arrow allows them to advance beyond the result.
For
example, if their query resulted in 1 of 4, they can still click to 5, 6,
and
so on which only adds blank lines to the database table. How do I set
this
to stop at the last entry of their original query?



  #3  
Old March 3rd, 2010, 09:22 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Stop advancing in form with the "next" arrow at end of "list"

On Wed, 3 Mar 2010 11:24:01 -0800, Duchess
wrote:

I have an editable form for users where they can query by date, etc.
However, the next entry arrow allows them to advance beyond the result. For
example, if their query resulted in 1 of 4, they can still click to 5, 6, and
so on which only adds blank lines to the database table. How do I set this
to stop at the last entry of their original query?


Set the AllowAdditions property of the form to No.

You may also want to have at least one field in the table Required, to prevent
the addition of blank records.
--

John W. Vinson [MVP]
  #4  
Old March 4th, 2010, 01:27 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Stop advancing in form with the "next" arrow at end of "list"

In addition to John's suggestion of making at least one field required,
setting AllowAdditions to No, can ause problems if there are no records
matching the search.
The details section can go completely blank. You can cancel the before
insert event and still leave AllowAdditions set to Yes.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"John W. Vinson" wrote in message
news
On Wed, 3 Mar 2010 11:24:01 -0800, Duchess

wrote:

I have an editable form for users where they can query by date, etc.
However, the next entry arrow allows them to advance beyond the result.
For
example, if their query resulted in 1 of 4, they can still click to 5, 6,
and
so on which only adds blank lines to the database table. How do I set
this
to stop at the last entry of their original query?


Set the AllowAdditions property of the form to No.

You may also want to have at least one field in the table Required, to
prevent
the addition of blank records.
--

John W. Vinson [MVP]



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:31 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.