View Single Post
  #8  
Old May 31st, 2010, 04:02 PM posted to microsoft.public.access
Pierkes
external usenet poster
 
Posts: 15
Default open form with no data

Hi Rick,

Tried your code...

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

What happened was;

1 form loaded blank (which is good)
2 the form "blinked" (which is not good...)
3 using the combobox on the form does not result in changing the data on the
form anymore (because the filter is on?)

Anuy ideas?
thanks,
Pierre


"Rick Brandt" wrote in message
...
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.