Continous Forms and preventing a new record being created

J

Julia

Hi

I have created a continous form which is a subform in a main form eg
Purchase Order main form (Purchase Order details). The Purchase Order can
have only 1 entry or 20 entries.

My problem is that after the first record is completed in the subform a new
record is created which means that each form has a blank record at the end of
the form, which I don't necessary want to happen. How do I prevent the
subform from automatically creating a new record.

Thanks
Julia
 
S

Steve Schapel

Julia,

Well, it's not actually "creating a new record". It's providing you a spot
where you can enter a new record if you want to. But a new record is not
actually created until you enter some data into that blank row.

Nevertheless, if you don't want that behaviour, you can set the Allow
Additions property of the subform to No.

And then, in order to then permit the entry of a new record, you will need a
way of handling that, which will involve using a macro or VBA procedure.
For example, you could have a little command button in the Header section of
the subform, with code like this on its Click event:
Me.AllowAdditions = True
DoCmd.GoToRecord , ,acNewRec

As well, you would then probably want this on the subform's After Insert
event:
Me.AllowAdditions = False
 

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