From: Daniel on
On all of the database's that I have created, in the forms property sheet
data section (when the form is in design view), I set the Data Entry to Yes.

Then in the vb, before the code for the combo box runs, simply insert Date
Entry = False.

Has worked fine for me from Access 97, right up to 2007.

Daniel


"Tom Wickerath" <AOS168b AT comcast DOT net> wrote in message
news:0E569607-4D80-471C-BE99-121E88984BD7(a)microsoft.com...
> No, Steve, the form will not display the record of interest. The reason is
> that the recordset contains no existing records. Try it out if you don't
> believe me.
>
>
> Tom Wickerath
> Microsoft Access MVP
> http://www.accessmvp.com/TWickerath/
> __________________________________________
>
> "Steve" wrote:
>
>> Hi Pierre,
>>
>> Add code to the open event of the form that opens the form to a new
>> record.
>> Your form will then be blank. Then when you choose a record ftom the
>> combobox, the form will display that record.
>>
>> Steve
>> santus(a)penn.com
>
From: Rick Brandt on
Pierkes wrote:

> Hi,
>
> I have a form on which i present al lot of data from a database.
> On the form is a comobox which i use to select the right record en present
> the data of this record on the form.
>
> When i open de form, de combobox is empty (which is good !) but the rest
> of the form is already filled with the data of a record in the database
> (which is not good). When i choose a record for the combobox, the form is
> filled with the data of that particular record (which is good).
>
> 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) ?
>
> Help will be much appreciated!

Just open the form with a WHERE argument that has no records returned.

DoCmd.OpenForm "FormName",,,"1 = 0"

If you are using the bookmark method to show records with your ComboBox
change that to applying a filter for the desired record.

No need to mess with DataEntry mode or change Recordsets.
From: Pierkes on
Hi Rick,

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,
Pierre

"Rick Brandt" <rickbrandt2(a)hotmail.com> wrote in message
news:hu084p$i0s$1(a)news.eternal-september.org...
> Pierkes wrote:
>
>> Hi,
>>
>> I have a form on which i present al lot of data from a database.
>> On the form is a comobox which i use to select the right record en
>> present
>> the data of this record on the form.
>>
>> When i open de form, de combobox is empty (which is good !) but the rest
>> of the form is already filled with the data of a record in the database
>> (which is not good). When i choose a record for the combobox, the form is
>> filled with the data of that particular record (which is good).
>>
>> 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) ?
>>
>> Help will be much appreciated!
>
> Just open the form with a WHERE argument that has no records returned.
>
> DoCmd.OpenForm "FormName",,,"1 = 0"
>
> If you are using the bookmark method to show records with your ComboBox
> change that to applying a filter for the desired record.
>
> No need to mess with DataEntry mode or change Recordsets.


From: Pierkes on
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,
Pierre


"Rick Brandt" <rickbrandt2(a)hotmail.com> wrote in message
news:hu084p$i0s$1(a)news.eternal-september.org...
> Pierkes wrote:
>
>> Hi,
>>
>> I have a form on which i present al lot of data from a database.
>> On the form is a comobox which i use to select the right record en
>> present
>> the data of this record on the form.
>>
>> When i open de form, de combobox is empty (which is good !) but the rest
>> of the form is already filled with the data of a record in the database
>> (which is not good). When i choose a record for the combobox, the form is
>> filled with the data of that particular record (which is good).
>>
>> 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) ?
>>
>> Help will be much appreciated!
>
> Just open the form with a WHERE argument that has no records returned.
>
> DoCmd.OpenForm "FormName",,,"1 = 0"
>
> If you are using the bookmark method to show records with your ComboBox
> change that to applying a filter for the desired record.
>
> No need to mess with DataEntry mode or change Recordsets.


From: Rick Brandt on
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.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: test II
Next: Resource For Help With Access