Locking a Form once data has been entered

Nis

Registered User.
Local time
Today, 16:00
Joined
Dec 21, 2012
Messages
23
I use a Form For entering data on a Permit Application. That form has a subform for job site details and that subform has a subform for recording equipment on site. The tables are linked.

The main form has a sequential numbering system as follows:

Me.Sequence = Nz(DMax("[Sequence]", "ROWPermit", "Year([InquiryDate])= " & Year(Me.InquiryDate)), 0) + 1

I have it set up so you can select an existing permit applicant from a combobox and update both subforms - you can save them and all is good.

The problem arises when some edits data in the main form. It now issues a new sequential number when closing. That compromises the permit numbering sequence.

Is there a way to block the main form from edits (either accidental or not) yet allow a new form to pop up when needed and still allow edits on the subforms? Ideally I'd prefer to edit the main form data in the datasheet view of the table as opposed to allowing it on the form.
 
Avoid the problem by issuing your sequence number only for new records.

ex:

Code:
If Me.NewRecord then
   Me.Seqence = Nz(Dmax(.....),0) + 1
End If

Jan R
 
Thanks very much JANR. Problem solved!
 

Users who are viewing this thread

Back
Top Bottom