Disappear the New Empty Record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a form with the DefaultView Property as Continuous Forms.
The record of this form contain 2 fields

My question is
When I click the ADD button in the form it adds a new record.
If i don't fill any of the fields of the new record and i focus another
record(field) of the continoous form, the form display and the empty
record(New).

How can I disappear the empty new record from the remainder list

Thanks in advance
 
Kimon said:
Hi,

I have a form with the DefaultView Property as Continuous Forms.
The record of this form contain 2 fields

My question is
When I click the ADD button in the form it adds a new record.
If i don't fill any of the fields of the new record and i focus
another record(field) of the continoous form, the form display and
the empty record(New).

How can I disappear the empty new record from the remainder list

Thanks in advance

That row is always shown as long as the form and recordsource for the form
support new record insertion. If you set the AllowAdditions property of the
form to No then that line should be removed.
 
Of course, if you do that, you'll also have to add a custom "Add Record"
button, because the native Access AddRecord button will be grayed out.
 
If i had only a field in this record it easy, i would use

in the lost focus property of the field : if me.newrecord = true and
isnull(fieldname (...)= true
then me.allowadditons = false but now i have 2 fields and i want to get the
position of the record (bookmark) to compare it, with the new position of the
record (if the user move the focus in an ohter record). That command i am
going to put it in te form property.

Thanks in advance
 
Kimon said:
If i had only a field in this record it easy, i would use

in the lost focus property of the field : if me.newrecord = true and
isnull(fieldname (...)= true
then me.allowadditons = false but now i have 2 fields and i want to
get the position of the record (bookmark) to compare it, with the new
position of the record (if the user move the focus in an ohter
record). That command i am going to put it in te form property.

I don't understand what you are saying. Do you want to allow new records to be
added or not? Or do you only want them to be added under certain conditions?
If the last then what are those conditions?
 
The conduition is : if the user don'fill any of the fields of the new record
and move the focus in an other record of the file then i want to set the
allowaddion off.
 
hi,

The problem I am dealing with is the following one:
In a continuous form, when the user clicks on the “add new record†button,
the form adds a new blank record.
When the user moves the cursor in another record of the list, without
filling the previously mentioned “new recordâ€, this “new record†remains in
the list.
How can I make the “new record†- which remains blank – disappear from the
list?

Another question also:

Can I use the command “bookmark†and how?

I would appreciate a prompt reply. Thank you in advance for your attention.
 
Kimon said:
hi,

The problem I am dealing with is the following one:
In a continuous form, when the user clicks on the "add new record"
button, the form adds a new blank record.

Unless you start out with AllowAdditions = No then this is not true. What
happens is that the user is navigated to the new record position that was
there all the time. It was just at the bottom where you couldn't see it.
That is why when they leave it, it is still there. On a form that allows
new entries it is ALWAYS there.
When the user moves the cursor in another record of the list, without
filling the previously mentioned "new record", this "new record"
remains in the list.

As stated, that is expected and normal. It is only a place to enter a new
record. It is not an actual record in the underlying table.
How can I make the "new record" - which remains blank - disappear
from the list?

You would have to set AllowAdditions = No in the Current event of the form.
Another question also:

Can I use the command "bookmark" and how?

Use it to do what? Usually it is used to navigate the form to a particular
record. You search teh RecordsetClone for a desired record, then set the
bookmakr of the form to the bookmark of the RecordsetClone and the form
moves to that record.

One of the choices in the ComboBox wizard will write this code for you so
you can see an example. Just pick the option to "Find a record on my form
based on the selection".
 
Back
Top