open search form blank

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to open a search form blank so that the user won't see anything on the
form until a specific record is chosen, say from a combo box. Is it possible
that I don't have to set the where condition as "new" to do so?
 
The form will show no records if you add this code to its On Open event
procedure:
Me.Filter = "(False)"
Me.FilterOn = True

If all the controls in the detail section then disappear, see:
Why does my form go completely blank?
at:
http://allenbrowne.com/casu-20.html
 
Thank you very very much Allen, it helps. I have one more question. As you
have predicted, everything disappears when I apply this filter. I put the
combo box at the form header section to at least make the selection possible,
so is it the only way to do so?

Thanks again for your help!
 
Yes: putting the filter boxes into the Form Header section makes sense
(though sometimes they can play up there too.)

The other alternative is to use an updatable RecordSource of your form, and
leave AllowAdditions as Yes. Then block the addition of new records by
cancelling the form's BeforeInsert event. That's my preferred approach where
applicable, but if you can't use an updatable source, this option doesn't
apply, because there won't be a new record anyway.

For an example of the way I usually create search forms, see:
http://allenbrowne.com/ser-62.html
 

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

Back
Top