Limiting lines in a table

Russp42

Registered User.
Local time
Today, 15:01
Joined
Nov 27, 2017
Messages
53
I have a table which has lines 1-18. On completion of the last line the cursor goes to line 19 to enable entry of new record. I have a form based on this table which has a number of calculated fields. The formulas are carrying down to row 19 even though I have not entered a new record. This is preventing me from performing some calculations on these calculated fields(eg Totals) How can I limit the table to only show lines containing data (18 lines)
 
Set the properties of the form to Data Entry - NO and this will remove the additional blank record.
 
As well as doing the change Tieval suggested, I would look at your formulas as totals shouldn't be affected by a blank new row anyway.
 
You can also turn off AllowAdditions in the form properties. I've always done that rather than using the DataEntry property (no particular reason why, except the the AllowAdditions/Edits/Deletes seemed a more semantic set of properties to me)

Cheers
 
Jack's suggestion (controlling "AllowAdditions") is very effective. I have used that myself many times in dynamic situations where you have to go through a specific procedural path to be allowed to add something to the table through the bound form. At least once I used it where it was based on the user's role as recorded in the Users table that built.
 
What are the formula for the Calculated fields?
you cant control the behaviour of the calc fields. Once you start typing on new record and goes to next field, the calc field will calc itself. The smart thing to do is make sure to default to 0 those field included in the cakc field, eg:

Suppose you have numeric fields A and B.
The calc field C expression is A + B.

Change the expression in C to:

Iif(IsNull(A), 0, A) + Iif(IsNull(B), 0, B)
 
Still the computation is correct until he fills all info.
Post #1 says its total not average.
 
If you have a problem adding new records, your code is in the wrong form events. You are dirtying a record before the user starts entering data and that is causing the problem.
 

Users who are viewing this thread

Back
Top Bottom