Solved

Need Help Trying to Implement a Parent - Child UI and Business Logic

Posted on 2006-06-26
1
171 Views
Last Modified: 2010-04-30
I am about ready to abandon what I've done and just add additional [Edit] buttons to the form. I would blame the 'fuzziness' on my meds, but all five of my doctors tell me I am perfectly normal :-)

I have an Employee class. Within this class, amongst all the other methods and properties, are three collections, one for Work phone numbers, one for Personal phone numbers and one for Addresses. An employee can have a primary, secondary, cell, pager, fax number, and separate home and mailing (as well as an alternate) addresses.

When the user goes into Update mode, all fields become updatable. The main one I am having problems with is the address. By default, the edit form displays the first available address (assume Home). There is a read-only combo box to the left of the address textboxes. The user can drop down the combo and chose Home, Mailing or Alternate. If an address exits for that address type, I retrieve a class with the properties and populate the text boxes. If no class exists in the collection, I create a new one, populate it with the address type code, and allow the user to enter data.

My main problem is determining how (and when) to handle getting all the data back into the collection. My thinking is way too much inside the box and for some reason I am having trouble visualizing this, handling data validation, the best way to handle persistence (as it stands now, it is an all or nothing scenario. The user makes all the changes they want, and when done, clicks [Save] - assuming all data is valid and [Save] has become enabled.

As I stated, one stumbling block I have encountered is what to do with the class that has been updated, in getting it back into the collection. If it is a new address, I have no problem as I have an AddAddress method on the collection that I pass a class to and it is added. Would it be appropriate to have an UpdateAddress method that accepts a class, finds the matching key in the collection and updates the properties one at a time? I guess with all my programming, I have never run across this scenario.

Would the experts recommend that I break apart validation of the main employee data from the address validation so the primary data can be saved even if an address is invalid and allow the user to then go in and correct the address (invalid address data would not be saved, it would just be ignored when other data was saved). Programming the way the user wants it can get to be a BIG pain.

Like I said at the start, part of me wnats to put an [Edit] button next to the address and then bring up a separate form to enter info. That would certainly help with the issue of knowing when to allow navigation away from the address data and if they do not get the address right, their only option is to click [Cancel] and go back to the main form.

Oh, great SAGES of the VB Code! Shed thy wisdom upon me!
0
Comment
Question by:dbbishop
1 Comment
 
LVL 13

Accepted Solution

by:
jmundsack earned 500 total points
ID: 16987458
I have run into this situation a lot--users wanting to update what is effectively child info directly on the parent info screen--and I always opt for the modal child form.  I let them view the child info read only, select between the various child records, and then have buttons to add, edit and delete.  It may not be exactly the way the user wants it, but it's usually way too much of a pain in the tuckus to deal with the other way.  The nearest compromise I've ever done (which was aggravating enough), was to simulate a modal form by having an editable set of controls appear in the same place as the read-only controls, while disabling every other control on the parent form.  But ultimately the result is the same: you want to edit child info, then you run a function to begin the edit, and then either save or cancel the edit.

HTH-Jon
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now