List Box Question

D

David W

Is there a way to refer to a listbox being empty?

What I am trying to accomplish is to open a form as hidden, check to see if
the list box has any data in it and if not , close it and if ti does to show
it, I tried with no previal - ANY IDEALS?

I tried this

DoCmd.OpenForm "reminder", , , , , acHidden
If IsNull(Forms!reminder.List4) Then
DoCmd.Close acForm, "reminder"
Else
DoCmd.Close acForm, "reminder"
DoCmd.OpenForm "reminder"
End If

Thanks
David
 
D

Douglas J. Steele

If Forms!reminder.List4.ListCount = 0 Then
DoCmd.Close acForm, "reminder"
Else
DoCmd.Close acForm, "reminder"
DoCmd.OpenForm "reminder"
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top