Creating new record in subform

T

Tony

i have the following code to lock/unlock the records. It works perfectly
aparting from creating new records in subform.

when my position is at a "locked" record, then i go to create a new record,
the subform is blank (cannot create records in subform)

when my position is at a "unlocked" record, then i go to create a new
record, the subform is ready to allow me to create new record in subform.

i have tried many combinations, it seems the problem is with the following
code.

Please help me.
Thanks a lot.

Tony



remark : "Forms!FrmApplicant!FrmOfficer!assignee" is null when creating the
new record

******code ********
dim assignperson
assignperson = currentuser()

If Forms!FrmApplicant!FrmOfficer!assignee <> assignperson Then
Me.AllowEdits = False
Me.AllowDeletions = False
Me.AllowAdditions = False
Else
Me.AllowEdits = True
Me.AllowDeletions = True
Me.AllowAdditions = True
 
A

Allen Browne

The subform should have its own AllowXXX properties. If you opened the main
form locked, you may need to unlock the subform control, and/or set the
properties of the form in the subform control.

Me.FrmOfficer.Locked = False
With Me.FrmOfficer.Form
.AllowEdits = True
.AllowDeletions = True
.AllowAdditions = True
End With
 

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