M
Marc Hillman
I have a conventional form with a subform. Form records are linked to
subform records via a link master field. Move to a different record on the
form, and the subform records change to synchronise with the current form
record.
A problem occurs when there are no records to display on the subform (ie no
child records). In the Current event method for the subform I set a few
buttons based on values in the current record. When there is no current
record, I get an error (2424) which is to be expected I guess, but why is
the current event called, and how do I skip it when there is no real current
record?
I've put "if Me.RecordsetClone.RecordCount > 0 then ... end if" around the
event handler to 'fix' the problem, but this is a bit of a kludge.
How do I robustly check that I actually have a real current record in the
current event, and not one of the other reasons that Current may be called?
TIA
_______________________________________
Marc Hillman, Melbourne, Australia
web: http://users.tpg.com.au/mhillman/
subform records via a link master field. Move to a different record on the
form, and the subform records change to synchronise with the current form
record.
A problem occurs when there are no records to display on the subform (ie no
child records). In the Current event method for the subform I set a few
buttons based on values in the current record. When there is no current
record, I get an error (2424) which is to be expected I guess, but why is
the current event called, and how do I skip it when there is no real current
record?
I've put "if Me.RecordsetClone.RecordCount > 0 then ... end if" around the
event handler to 'fix' the problem, but this is a bit of a kludge.
How do I robustly check that I actually have a real current record in the
current event, and not one of the other reasons that Current may be called?
TIA
_______________________________________
Marc Hillman, Melbourne, Australia
web: http://users.tpg.com.au/mhillman/