What Event Can I Use to Capture Next Record Selection

E

EarlCPhillips

I want to zero out some fields each time I display a new record using the
record selectors. What event is fired when a next, prior, first or last
record selector is clicked?

Earl C Phillips
Ex-Mainframer Learning Access To Feed The Hungry
Harvesters Community Food Network
Kansas City, MO Metro Area
 
J

Jim Burke in Novi

If these fields are bound fields (i.e. the form is bound to a table and these
fields are from that table) you can just set the default value for those
fields in the table definition. If they're bound, I wouldn't think you'd want
to set them to 0 unless it's a new record. If they're not bound, set the
Default property of each field to 0. I think that should do it.

Jim Burke - another ex-mainframer (20 years) still adjusting to the Windows
world after all these years.
 
E

EarlCPhillips

The fields are not bound and the default is set to zero. I use these fields
to calculate totals about each displayed record when I click a button while
that record is displayed. Once set for any displayed record, the values do
not reset to zero when I display the another record. Therefore I must find a
way to reset them to zero or recalculate totals for the newly displayed
record using some event when I change records.

EarlCPhillips
Ex-Mainframer Learning Access To Feed The Hungry
Harvesters Community Food Network
 
J

John Spencer

Use the form's current event to reset the values to null or zero or
whatever.


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
E

EarlCPhillips

Thank you, John. You come to my rescue again. You are helping us feed the
hungry with greater efficiency in Kansas City.

EarlCPhillips
Volunteer Ex-Mainframer Learning Access
Harvesters Community Food Network
 
J

John Spencer

You are more than welcome. I like helping and get extra pleasure when
what I do helps charitable organizations.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
J

Jim Burke in Novi

Why wouldn't a default value work for this? Just curious. Seems like it
should work , and it wouldn't require any special code (as simple as the code
is). I tested it out myself and it worked fine.
 
L

Linq Adams via AccessMonster.com

You're feeding those hungry people Kansas City Barbeque, I hope!

;0)>
 
J

John Spencer

Well, since the controls are not bound they don't change when you move
from record to record on the form. They will keep the value that was
placed in them during this session.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
A

Albert D. Kallal

Jim Burke in Novi said:
Why wouldn't a default value work for this? Just curious. Seems like it
should work , and it wouldn't require any special code (as simple as the
code
is). I tested it out myself and it worked fine.

What you suggest would work fine. The question is not clear if by "next"
record we mean adding a new record, or simply "moving" to the next record.

If indeed the original question is about adding a NEW record, then
on-current is not the best choice here.....

You are correct that when you add a record, the "default" setting(s) would
ONLY effect when new records are being added...we not just too sure if we
talking bout adding new records..or "moving" to a record....

if moving..then the "on current" event is about the only choice here. If we
taking about a new record, then using defaults settings is likey perffered
since no coding at all is required....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top