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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form/subform design question

Status
Not open for further replies.

rafe

Technical User
Aug 18, 2000
194
0
0
US
Hi again,

I know how to do most of the following, but I want to ask how do the experts (you) handle this? I’ve run into headaches trying to back-out some of my newbie baby steps (fortunately I’m the user for now) and I’m trying to avoid this in the future.

When you are designing a form/subform (header/line item) with complicated validations that happen after the end of the last line item entry. Do you:

1) Enter items on the fly & back out the entries if they fail the validations. My intuition says no to this, but there may be good reasons I’m missing.

2) Place you header & line items into a buffer table & only move them over, en masse, to the real tables if all criteria are met. Maybe, seems straight forward to program but maybe there are good reasons to avoid this.

3) Use a system of memory buffers & then move header & line items, en masse, into tables if criteria are met. This seems to be the best but then again it may wind to be a real bear to program or am I over estimating the work involved in making this solution look like #2.

rafe
[sig][/sig]
 
The before update event of the Form is entered prior to updating the record, put your validations in this event. [sig][/sig]
 
one vote for option #1

or am i not understanding your answer. because if the validation fails (after the entry of the last line item record), i don't want the header record or any of it's linked line item records in the database. [sig][/sig]
 
I use this type of approach to an order form with an order details subform.
I work with Access as the front end to SQL7.

The main order form is an unbound form.(the user fills in a blank form for new entries, or code is used to load the form with existing data for editing orders)

The details subform is bound to a local table. When the user clicks save, I run my business rules test and if the results are ok, the information from the main form is saved to the order table and the order details are added to the detail table. (any changes to the details section of an existing order require all old details to be deleted, and replaced with the new line items)

This prevents any data from being entered into the final tables untill the rules are satisfied.

Need help? Just ask!

John [sig]<p>John A. Gilman<br><a href=mailto:gms@uslink.net>gms@uslink.net</a><br>[/sig]
 
John,

Thanks! Sounds like your DB is much more advanced than what I'm doing. Just to clarify, your &quot;local table&quot; is an Access buffer table on the front end system & the &quot;final tables&quot; are the in the DB on the server system? You're doing an advanced version of option #2.

I'm to that awkward stage as a newbie where I can figure out how to do most things... but just because I can do it doesn't mean that I should! Which is why advice like this this is a big help; design it right the 1st time & minimize rewrites.

thanks again

rafe [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top