Dcount type of function on a form

  • Thread starter Thread starter slickdock
  • Start date Start date
S

slickdock

What can I use on a continuous form to tell me when there are no records on
the form? I can't dcount the underlying query of the form, because the user
might further filter records on the form as well. I want to know the moment,
through additional filtering techniques, the form shows no records.

Thank you.
 
What can I use on a continuous form to tell me when there are no records on
the form? I can't dcount the underlying query of the form, because the user
might further filter records on the form as well. I want to know the moment,
through additional filtering techniques, the form shows no records.

Thank you.

I don't quite follow you here.
If there are no records to show, the form will show no records.

In any event, code the form's Current event:
If Me.RecordsetClone.RecordCount = 0 then
MsgBox "There are no records to show."
End If
 
Thank you. How could I put the me.recordsetclone language in a condition for
a macro? I want to msgbox the user and then force the form to close.
 
Try Forms!NameOfForm.RecordsetClone.Count

(replace NameOfForm with your actual form name...)
 
Thanks, Doug. Unfortunately, now I'm getting "object doesn't contain the
automation object 'Count.'
I tried it both of these ways in the macro conditions argument:

[Forms]![frmCal].[RecordsetClone].[Count]=0
and...
[screen].[activeForm].[RecordsetClone].[Count]=0

I prefer to use Screen.ActiveForm if possible, because this macro is called
from several forms. Hope you can help. You almost always can!!
 
slickdock said:
Thanks, Doug. Unfortunately, now I'm getting "object doesn't contain the
automation object 'Count.'
I tried it both of these ways in the macro conditions argument:

[Forms]![frmCal].[RecordsetClone].[Count]=0
and...
[screen].[activeForm].[RecordsetClone].[Count]=0

I prefer to use Screen.ActiveForm if possible, because this macro is
called
from several forms. Hope you can help. You almost always can!!

Douglas J. Steele said:
Try Forms!NameOfForm.RecordsetClone.Count


Should be ".RecordCount", not ".Count".
 
Thanks! I actually just found it, and I was coming back to post the answer.
And it does work with screen.activeform.
Thanks both of you! good teamwork!

Dirk Goldgar said:
slickdock said:
Thanks, Doug. Unfortunately, now I'm getting "object doesn't contain the
automation object 'Count.'
I tried it both of these ways in the macro conditions argument:

[Forms]![frmCal].[RecordsetClone].[Count]=0
and...
[screen].[activeForm].[RecordsetClone].[Count]=0

I prefer to use Screen.ActiveForm if possible, because this macro is
called
from several forms. Hope you can help. You almost always can!!

Douglas J. Steele said:
Try Forms!NameOfForm.RecordsetClone.Count


Should be ".RecordCount", not ".Count".

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 
Back
Top