Try referring to the RecordsetClone of the form rather than its Recordset:
Me![cmdButton].Enabled = Me![subForm].Form.RecordsetClone.RecordCount > 0
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Boris" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On some computers (of course only at the client :-) this VBA code throws
> error 429:
>
> Me![cmdButton].Enabled = Me![subForm].Form.Recordset.RecordCount > 0
>
> This code is used in Form_Current(). The idea is that a button on the form
> should only be enabled if there is at least one record in a subform.
>
> This code works on my computer (Access 2003) and also worked for a long
> time on the computers of the client (Access 2002 and Access 2003). For
> some reason this line stopped working now. While the error is caught in
> Access 2003 I've seen Access 2002 sometimes even crashing.
>
> I don't know if the client changed the configuration and/or installed new
> programs. Does anyone have an idea why this code might not work and what
> might cause runtime error 429? Could this be a race condition as the
> number of records of a subform is checked while Form_Current() is
> executed? Or could it be related with DAO?