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.