No edit previous forms after new form

J

JACKGUNAWAN

Hi,

1. I have a data entry form and subform. How can I set for no edits and no
deletes of all previous forms and subforms after new form or new record is
created?

2. I often encounter loss of records in the database. Does deleting records
and compacting database affect this? What are the common causes?

Thanks for your time.


Ps. I am inexperience in modules.
 
J

John W. Vinson

Hi,

1. I have a data entry form and subform. How can I set for no edits and no
deletes of all previous forms and subforms after new form or new record is
created?

ummm... do you really, really want to make it impossible to correct errors in
the data?

How stringent do you want to be? Making it so the user, working within the
form, is prevented from doing so can be accomplished by using the Form's
Current event toggles the form's Allow Updates property:

Private Sub Form_Current()
Me.AllowUpdates = Me.NewRecord
End Sub

If you're trying to stop someone from intentionally (perhaps maliciously)
deleting records, it's much more difficult.
2. I often encounter loss of records in the database. Does deleting records
and compacting database affect this? What are the common causes?

Deleting records obviously... deletes records, causing a loss of records.
Compacting should NOT do so. How are you ascertaining that records are being
lost? Directly in the table? Autonumber values will develop gaps, either from
deletion of records or just from hitting ESC while a new record is open,
before it's saved; this isn't really loss of records. Also if you're looking
at a Form, Query or Report, the record might just not be visible because it's
filtered out. If you actually have a record that you know was there; nobody
intentionally deleted it; and now it's gone from the table, you may have a
real problem. 99% of the time, though, someone is (intentionally or
accidentally) deleting the record; this can happen when someone thinks they
can delete a record from a Query "I'm just deleteing from the query, not from
the table" - NOPE! it's deleting from the Table.
 
J

JACKGUNAWAN via AccessMonster.com

Hi John,

Thanks for the quick reply. Since I am inexperience with codes, where do I
place the codes:

Private Sub Form_Current()
Me.AllowUpdates = Me.NewRecord
End Sub

Thank you.

Jack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top