View Single Post
  #5  
Old May 30th, 2010, 10:48 PM posted to microsoft.public.access
Rick Brandt
external usenet poster
 
Posts: 4,354
Default open form with no data

Pierkes wrote:

Hi Rick,

I tried to reply to the group earlier but didn't see it appearing so
here's another go...

Thanks for your code, it works !

However, i do not use the DoCmd.OpenForm "FormName",,,"1 = 0" to open the
form but instead, to get the form to open in a subform, i use ;

SubFormArea.SourceObject = "Houses"

Any idea on how to adjest this code so it opens with a blank sheet ?
Thanks in advance,


Well, that does change the parameters of the question quite a bit. You
could try...

SubFormArea.SourceObject = "Houses"
SubFormArea.Form.Filter = "1 = 0"
SubFormArea.Form.FilterOn = True

....but I'm not sure if that would first "blink" on a record before the
filter is applied.

If you are going to use a subform then you might be best to put the ComboBox
in the main form and use the MasterLink and ChildLink properties to do the
filtering. In that case as long as the main form starts out with a ComboBox
entry that has no match in the subform then you should get a blank subform
until you change it.