OnCurrent Event

  • Thread starter Thread starter Randy Hartwick
  • Start date Start date
R

Randy Hartwick

I have a form with several fields that are conditionally
displayed. I have a subroutine written in VB attached to
the OnCurrent Event of the form to determine whether these
fields should be displayed or not. When I first open the
form my subroutine works, however, when I move to another
record the the fields do not change. The help file says
this event should fire every time you move to a new
record. What gives?

Thanks,

Randy
 
Disregard this message. I was not initializing some of
the fields and I had not taken this into account. Problem
solved.

Thanks,

Randy
 
I have a form with several fields that are conditionally
displayed. I have a subroutine written in VB attached to
the OnCurrent Event of the form to determine whether these
fields should be displayed or not. When I first open the
form my subroutine works, however, when I move to another
record the the fields do not change. The help file says
this event should fire every time you move to a new
record. What gives?

Thanks,

Randy

The current event does fire each time you move to a new record on that
form.

To check that the event is 'firing', place a breakpoint on the first
possible line in the event.
Does the code stop at that point?
If so, then it is firing.
What happens if you then step through the code?
If the code is an If..Then statement, are the conditions being met?
You can hover the cursor over any of the field names in the code and
compare what the values are as to what you expect them to be.
If the condition is not met do you have code to return the controls
back to their original state (using Else)?

If you still have difficulty, post the entire code here with a
description of what you expect to happen.
 
Randy Hartwick said:
I have a form with several fields that are conditionally
displayed. I have a subroutine written in VB attached to
the OnCurrent Event of the form to determine whether these
fields should be displayed or not. When I first open the
form my subroutine works, however, when I move to another
record the the fields do not change. The help file says
this event should fire every time you move to a new
record. What gives?

Please post the code from your event procedure. Have you tried placing
a breakpoint on the procedure header, so you can see whether it gets
called every time to move to a new record? Assuming it does, you can
then step through the code to see where it goes wrong.
 
Back
Top