On Current event not triggering

teambond

Registered User.
Local time
Today, 15:12
Joined
Jun 2, 2013
Messages
24
Hi,

I have an issue with a subform that I am enabling or disabling depending on the status shown on the main form. I have an event occurring at "On Current" on the subform that checks the status of the main form and if it is new record or status "open" set allow additions/edits/deletions to true. If it is any other status they are set to false.

This works great until you scroll from a record that has the subform add/edit/delete set to false, to the next record where the status is "open (ie should allow additions etc) but that does not have any current entries in the subform.

I can see when I run in debug that the move from the record with the locked subform to the record that should allow edits, it does not trigger the on current event. It is not related to the record itself but to the status of the record it is scrolling from. This only occurs if you scroll to a record with no data in the subform. Otherwise it works fine.

Can anyone suggest what trigger I should be using if the On current event is not going to be triggered in this case?

Thanks
 
the problem is that where there is no record in a form that does not allow entries all controls are undefined (as good a term as any), and no events fire.

you probably need to test and set the subform from the mainform current event as well
 
If you always want the new record in the subform to allow edits etc. then you should first test for that and ignore testing your main form status if the subform Me.NewRecord = True.
 

Users who are viewing this thread

Back
Top Bottom