SubForm Add only?

Y

Ynot

I have a form with a subform. I would like the subform to open in add only
mode is that possible. I want to allow multiple additions but no changes
once the record is added.
 
J

Jim Allensworth

I have a form with a subform. I would like the subform to open in add only
mode is that possible. I want to allow multiple additions but no changes
once the record is added.

Set the subforms Data Entry property to Yes.

In its After Insert event put ...
Me.Requery

Now the user can add records but they will not be able to scroll back
up to previous entries.

- Jim
 
Y

Ynot

That works when I open the subform alone but when it is opened as part of
the main form; when line one is entered you are ready to enter line 2 but
you can go back to line one and change it. I have to be able to list all
items associated with the master form just not allow changes after they are
entered.
 
J

Jim Allensworth

That works when I open the subform alone but when it is opened as part of
the main form; when line one is entered you are ready to enter line 2 but
you can go back to line one and change it. I have to be able to list all
items associated with the master form just not allow changes after they are
entered.
Ok, if you want to be able to view the previous records but not allow
editing them then put this in the subforms On Current event. Like ...

Private Sub Form_Current()
Me.AllowEdits = Me.NewRecord
Me.AllowDeletions = Me.NewRecord
End Sub

- Jim
 

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