From: Pierkes on
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" <rickbrandt2(a)hotmail.com> wrote in message
news:hu0i6q$739$1(a)news.eternal-september.org...
> 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.


From: David W. Fenton on
"Pierkes" <info(a)advisearch.nl> wrote in
news:4c02a554$0$15511$703f8584(a)news.kpn.nl:

> So the only problem i have is on opening the form. Is it possible
> to open the form without it being filled with data of a certain
> record (so is see a blank form) ?

Use a recordsource like this, where "MyTable" is the smallest table
in your application, and the fieldnames are the fields controls on
the form are bound to:

SELECT TOP 1 Null As Field1, Null As Field2, Null As Field3
FROM MyTable

This gives you a single blank record that is uneditable. You would
then change the recordsource in the code that does the search.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
First  |  Prev  | 
Pages: 1 2 3
Prev: test II
Next: Resource For Help With Access