OnExitRecord problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Need:
I need an event that will trigger my code when a user transits from one
record to another on a form in continuous forms view, After some digging I
found this property "OnExitRecord" which according to the documentation would
appear to satisfy my need.
Problem:
I can't find this property in the Properties sheet of the form in question,
but when I use the object browser it appears as a "hidden member". Can
someone please explain what this is about, I can't find any references to
"hidden member" to try and figure this out?

Many thanks to whomever can shed some light!

Paul
 
The right event that will trigger your code when a user transits from one
record to another on a form in continuous forms view, is the oncurrent
event of the form.
 
Thank you for that!

I should have been more specific, I need to trigger only when a user exits
the record. The problem with On Current is that it triggers when the user
selects the record and this doesn't work for me.
Paul
 
Paul said:
Thank you for that!

I should have been more specific, I need to trigger only when a user
exits the record. The problem with On Current is that it triggers
when the user selects the record and this doesn't work for me.
Paul

There is no event that fires just before you leave a record (although it's been
a requested feature). If the record has been dirtied you can use BeforeUpdate,
otherwise you would have to eliminate ALL built in methods of record navigation
(there's more than you think) and provide your own method for navigating ( a
button for example). Anything you want to do before leaving the record can be
done in that button's code.
 
Thank you Rick for your reply and suggestion.
I don't think this will change anything but when I wrote the original
question I inverted the property name, it should have read "OnRecordExit" and
not "OnExitRecord", sorry about that. In any case, can you explain why this
property shows up on my on-line help and also shows in the object browser
when I select 'Show Hidden Members'.
I pasted the property and event descriptions below. I think you wil agree
this is exactly what I am looking for.

Thanks again!!!


-------------------------------------------------
OnRecordExit Property
See Also Applies To Example Specifics
Returns or sets a String indicating which macro, event procedure, or
user-defined function runs when the RecordExit event occurs. Read/write.

expression.OnRecordExit

expression Required. An expression that returns one of the objects in the
Applies To list.

Remarks
Valid values for this property are "macroname" where macroname is the name
of macro, "[Event Procedure]" which indicates the event procedure associated
with the RecordExit event for the specified object, or "=functionname()"
where functionname is the name of a user-defined function. For a more
detailed discussion of event properties, see "Event Properties."

Example
The following example specifies that when the RecordExit event occurs on the
first form of the current project, the associated event procedure should run.

Forms(0).OnRecordExit = "[Event Procedure]"

------------------------------------------
RecordExit Event
See Also Applies To Example Specifics
Occurs just before the user exits the current record.

Private Sub Form_RecordExit(Cancel As Integer)

Cancel Set this argument to True to prevent the user from exiting the
current record.

Remarks
The event occurs after the user has done something to move away from the
current record, either by navigating to another record, closing the form,
refreshing the form, or requerying the form, but before the view of the
current record has been discarded. Use this event to examine records before
they are no longer the current record to ensure that data validation rules
have been met.
 
Paul said:
Thank you Rick for your reply and suggestion.
I don't think this will change anything but when I wrote the original
question I inverted the property name, it should have read
"OnRecordExit" and not "OnExitRecord", sorry about that. In any case,
can you explain why this property shows up on my on-line help and
also shows in the object browser when I select 'Show Hidden Members'.
I pasted the property and event descriptions below. I think you wil
agree this is exactly what I am looking for.

Because the event was actually in a beta version of Access that never made
it to the final release, but somehow still made it to the help file.
 
That was quick!
Thank you, now I can rest!
I am using Access 2000, do you know if this event is available in a more
recent version, or is still in development?

Paul
 
Back
Top