Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 10th, 2003, 08:53 PM
myaccess myaccess is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: usa
Posts: 6 myaccess User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Turning off "editing" in forms last record.

Hi guys,

I'm in a picle here. I can't seem to fina any info on turnong
turning off "editing" or is it, "adding new record" in my forms
last record.

Here is my case.

In the code below, I have some calculations that add some numbers
on my form and displays them during a Form's PgDn/Pgup so that
the user can see at a glance, what values to react upon..

Code:
Private Sub Form_Current()
 ... code snips
End Sub


Becuase this code is in the _Current() area, and when the user is
at the end of the record on the form, say for example, usre is on
records 60 of 60.
The user is usually not careful enough (inluding myself) and I or
the users will make the mistake and continuing pressing the PgDn
key (or holding it there) and before you know it, NEW blank records
are added (lots of them)

I need to know how to overcome this problem. Is there something
that I can code or whatever, that will NOT add new records when
there user is at the end of the last record on a given form ?

Note, I've tried messing around with the:

Cycle - All records; Current record; and Current page

but that does not work for me, or it completely DISABLES my ability
to add a new record, even if I press my Ctrl_+ key add a
new record.

If I can turn it on/off at will through code, when at the right moment
in the form, I would really appeciate it.

Thanks for any assistance on this.

EDIT: - I forgot to mention, that at every record a user is on,
that ../ (<--- is a pencil) is always displayed in the top left
corner. But, this is only when I have code in the _Current() sectoin.

-myaccess

Last edited by myaccess : December 10th, 2003 at 09:03 PM.

Reply With Quote
  #2  
Old December 11th, 2003, 06:39 AM
TBÁrpi's Avatar
TBÁrpi TBÁrpi is offline
Lazy User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Hungary, Europe
Posts: 337 TBÁrpi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 5 m 5 sec
Reputation Power: 5
Send a message via MSN to TBÁrpi Send a message via Yahoo to TBÁrpi Send a message via Skype to TBÁrpi
When you load the form, you can capture the number of records in the underlying table/query by reading the form's Recordset.RecordCount property, and in the same time, you can capture the current record number by reading the form's Recordset.AbsolutePosition property.

AbsolutePosition is indexed from 0 so when you're on the first record, then the AbsolutePosition is 0.

When you're on the last record, the AbsolutePosition equals to RecordCount-1. So it tells you where you are in the Recordset.

Play around with these properties to enable or disable adding records by using the form's AllowAdditions property in the form's OnCurrent event handler.

If the form is a single form (i.e. shows a single record at a time) Cycle property is recommended to be set to Current Record.
__________________
BRegs,
TBÁrpi
"I can only show you the door. You're the one who has to walk through it."

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Turning off "editing" in forms last record.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway