Subform adding new records

D

Dickie

I have a Form which as a embedded subform. The Subform is used to enter Line
details for a Purchase Order.

The Subform is a tabular form. so when I get to the last Field on the form
a new line is created. Can anybody tell me what the command is to check for
the creation of a new Line. (I.E. When I press TAB or Return from the Last
field, rather than using the Lost Focus command, use a command which says
end of line, new line created)

Thanx
 
A

Allen Browne

The BeforeUpdate event of the Form fires before the entire row in your
subform is saved. Use that event for any validation.

After the record is saved, the form's AfterUpdate event fires. Use that
event if you want to respond to the record that was just saved.
 
D

Dickie

Thanx for that, but when I do this it does not move to the next line it will
only allow me to put 1 Line on the subform.

I'm only validating certain fields on the report.
 
A

Allen Browne

If you *cancel* Form_BeforeUpdate you will not be able to move to another
line in your subform.

I did not undrestand the bit about validating fields in a report.
 
D

Dickie

On the after_update event,
I check that a valid date is entered in a Form field and also Copy a Row
Number (generated via a module) into a control field called Purchase Order
Detail Line, this field is a control field on the forms control table.
As far as I am concerned I'm not running any cancel update commands, but it
will still not move to the next line, it stays on the last field on the row.
No error messages are displayed.
 
A

Allen Browne

Sorry, I have no idea what is supposed to be going on in your form.

The AfterUpdate event of what? The form? A control?

A row number is generated via a module? You are assigning numbers? via code?
To a bound control? In one of the AfterUpdate events? In a stand-alone or
multi-user environment?

You are expecting the record to move to a different row? Or you are unable
to move to a different row?

Do your procedures have error handling that could be suppressing messages?
Do you get a message if you close the form? Is the Record Selector
indicating the subform record is dirty at this point?
 

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