Re: Blank records when form closes



Ok, most of the time I will get a blank just opening and closing the form,
but I have done it when I first open Access and not gotten the blank. The
Immediate / Debug shows the form dirty most of the time, so that is how I
have things set up. I have tried to use Undo as part of the code for the
close button, but it will mess up my last record if the form is not dirty.
When I enter a record I have an "add record" button that goes to "new
record", but the form is not dirty then, so some, but not all the fields are
deleted, when the Undo runs.
Is there a way to code this with an IIf statement (or something similar).
What I tried did not compile.
Thanks
Bruce Hawkins

"Al Camp" <anon@xxxxxxxx> wrote in message
news:O9O9yJAuFHA.3752@xxxxxxxxxxxxxxxxxxxxxxx
> This is usually caused by "Default Values" being entered into fields on
> a New record. If any kind of Update or Refresh occurs before closing out
> the form, that record is saved, and it appears to be a "blank record".
>
>> (actually a record with all the default values entered and no name).
>
> Try opening a new record, and closing it right away... any blank record?
> If not, then those "occasional" times you get a blank you may have done
> something to trip off an Update. (clicked in the subform, or put the
> cursor in some field, clicked a button, etc... etc...) Something you're
> doing is causing the new record (with defaults) to Update. Check out all
> your subform code...
>
> hth
> Al Camp
> Candia Computer Consulting - Candia NH
> http://home.comcast.net/~cccsolutions
>
>
>
> "Bruce Hawkins" <bhawkinsbw@xxxxxx> wrote in message
> news:OwMRl3$tFHA.3188@xxxxxxxxxxxxxxxxxxxxxxx
>>I have a data entry form that enters data in a table, no query involved.
>>On the form I have a subform that shows the data from the table for the
>>section that is selected in a combo box on the form.
>>
>> If I open the form, pick a section, the data displays, and I can add
>> names and data to the table ( most of the data is picked in combo boxes
>> on the form). Seems to work fine, but if I open the form, do nothing and
>> then close the form it will sometimes insert a blank record in the table
>> (actually a record with all the default values entered and no name).
>>
>> Can anyone explain what is happening, and how I can prevent it? I have
>> tried some code for undo record in the close button but that just messes
>> up the last entry, and does not work for the open/close problem. It does
>> not seem to be a problem with just a simple data entry form with text
>> boxes and no subform.
>>
>> Thanks.
>> Bruce Hawkins
>>
>
>


.


Loading