Solved

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

Posted on 2006-06-26
1
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

733 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