Max Wanadoo
max.wanadoo at gmail.com
Mon Sep 14 11:45:45 CDT 2009
I know, just replace "MyTable" with whatever the table name or query name is that populates the form. Do this with the OnOpen event of the form. Should have said that, but I thought it was obvious.. Max -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 14 September 2009 17:10 To: Access Developers discussion and problem solving Subject: Re: [AccessD] Number of records in a form Max, He does specify "the table linked to the form" but IMHO it is better to go directly to the form to find out if it is pulling any records. There may be records in the table but none pulled by the form. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > Loads of ways, Dale > > One simple way is: > > If dcount("*","MyTable") = 0 then > Msgbox "OMG where have the records gone" > Else > Msgbox "Phew, here they are" > Endif > > Max > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dale Kalsow > Sent: 14 September 2009 16:02 > To: Access Developers discussion and problem solving > Subject: [AccessD] Number of records in a form > > Good Morning Everyone, > > I am trying to figure out if when a form opens if there are any records in > the table that is linked to the form. If not then I want to display a > special text box. > > Does anyone know how to tell if the table is empty? > > Thanks! > > Dale > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com