Solved

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

Posted on 2006-06-26
1
176 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

910 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

20 Experts available now in Live!

Get 1:1 Help Now