"On Current" Event Confusion

mhermher

New member
Local time
Today, 03:47
Joined
Sep 19, 2009
Messages
8
Hi all,

This is what I want to do. I have some text fields and command buttons that I would like to toggle enable/disable based on a a field in the current record. As the user flips through the records, I would like the fields to be either disabled or enabled based on a property of that selected record. Many sources online suggest using the "On Current" event.

When I implemented this idea I am getting a weird result. I have figured out that the on-current event is evaluating the property of the record being switched FROM, not the record being switched TO. I do not know if there is something wrong with my code or with the idea of using the on-current event for this. Here is my code under the on-current event:

If Me.Status = "Together" Then
Me.JoinD.Enabled = False
Me.JoinMal.Enabled = False
Me.JoinTo.Enabled = False
Me.SepOn.Enabled = True
Me.SepD.Enabled = True
Else
Me.SepOn.Enabled = False
Me.SepD.Enabled = False
Me.JoinD.Enabled = True
Me.JoinMal.Enabled = True
Me.JoinTo.Enabled = True
End If

Thanks for any help.
 
Mhermher,

Using the Current event of the form is the correct approach, and I can think of no reason why it wouldn't work correctly. The results you are reporting are unexpected. If you could attach a zipped copy of this database, someone may be able to have a look at it... but to me this is very strange.
 
Is this on a continuous form?
 
The Form_Current event, as Rich has suggested, will only work if this is a Single View Form, not a Continuous View or a Datasheet View Form. For these type of forms you'll need to use Conditinal Formatting off of the Formating Menu.
 
missinglinq said:
The Form_Current event will only work if this is a Single View Form, not a Continuous View or a Datasheet View Form.

Well, I don't think it can be a datasheet, because Mhermher is talking about command buttons. And if it was a continuous view form, it still wouldn't result in the behaviour that he/she described. No?
 

Users who are viewing this thread

Back
Top Bottom