Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allow Additions = No prevents data being displayed properly

Status
Not open for further replies.

TrekBiker

Technical User
Nov 26, 2010
330
GB
I have a Customers form with a subform for completed orders.

Picking an order and clicking an Orders button opens an Order Details form that shows the order’s Products and Credits in separate subforms.

I want to prevent a user from accidentally changing the details so have set each subform’s Data properties to Allow Additions = No, same for Allow Deletions and Allow Edits. The Order Details display properly for orders that contain entries in Products and Credits but if either doesn’t I get errors in the calculation fields below, which pull data from the OrderSubtotal and CreditTotal summations in the footers of each subform, ie

= [sfmOrderDetailsSubform].[Form].[OrderSubtotal]
= [sfmCreditAmounts].[Form].[CreditTotal]

This is stopping the next step of allowing additions etc if it’s essential to make changes.

So the question is how to extract details from the subforms when their data properties have been set to not allow additions, deletions and edits.
 
I have resolved this by adding an On Load event to each subform in Order Details to check if there is any data to display and to set the data properties accordingly.

This leaves a possible scenario where any of the three subforms that ends up allowing additions, deletions or edits might lead to accidental changes to existing orders but that's as close as I can get.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top