T Terry DeJournett May 9, 2006 #1 Can I get an error message to display if a select query does not find any records? And can it be customized? Thanks in advance.
Can I get an error message to display if a select query does not find any records? And can it be customized? Thanks in advance.
F fredg May 9, 2006 #2 Can I get an error message to display if a select query does not find any records? And can it be customized? Thanks in advance. Click to expand... Not using a query, but if you create a form using the query as it's record source to display the query results you can. Set the Form's Default View property to Datasheet and it will look just like a query. You can code the form's OPEN event to not open the form if there are no records: If Me.RecordsetClone.RecordCount = 0 then MsgBox "There are no records to display." Cancel = True End If
Can I get an error message to display if a select query does not find any records? And can it be customized? Thanks in advance. Click to expand... Not using a query, but if you create a form using the query as it's record source to display the query results you can. Set the Form's Default View property to Datasheet and it will look just like a query. You can code the form's OPEN event to not open the form if there are no records: If Me.RecordsetClone.RecordCount = 0 then MsgBox "There are no records to display." Cancel = True End If