make subform info required before close

Joso

Registered User.
Local time
Today, 14:19
Joined
Dec 4, 2004
Messages
28
hi everyone. I am stuck in a dilemma. I have 2 tables:

tblPerson
PersonId
LastName
FirstName
Title
Gender

tblClient
PersonID
Address
City
Email
etc...

1 to 1 relationship

On the main form i have a tab control with 2 tabs. On the first tab i have the tblPerson info which is part of the main form. On the secod tab i have a subform for tblClient info. Each tab has a save button. Right now, a person can be entered and close the form without having anything entered in the second tab sub form (tblClient). I want to make sure that if someone enters a new person in the main form they are required to enter the rest of the info in the second form then save the changes on that tab.

If anyone knows what is hould do that would be great.

Joso
 
If anyone has a solution for this, that would be great. I need some serious help on this.

Joso
 
On the form_Close event, cycle through all data controls in the subform, if any are null, then issue an appropriate message and then cancel the close.

You may find that some null values are accptable.
 
Have a data validation button which displays a close button, form close control, and enables clt-F4, which are other wise disabled, when all or threshholds field have data, otherwise they remain disabled/hidden.
 
the way my tables and forms are setup, is i have 3 forms, 1 for each person type, client, doctor and business contact, each haveing a seperate table linked to one parent table called tblPerson. Let's say i go into frmClient, everyones tblPerson info is there regardless of whta type of person you are.
I did use somebody's suggestion and used canclose, but like i said tblPerson has the name, gender and phone numbers of everyone then that links to a seperate table for each type of person. I could go in frmClient and cycle through all the records for the main table and see doctor's and business contacts name with null fields for the subform. WIth the canclose it that made it mandatory for every person in tblPerson to become a client with the subform filled.
Here is my database http://members.shaw.ca/joso/DB.zip I couldn't compress it below 100kb limit of this forum, so i uploaded somewhere else.

The reason i want to validate the sub form is because based on my realtionship if they don't enter anything in the subform, it doesn't show up in my search combo box (union query).

Thanks for all the help. Maybe there is even a better solution for my design. Or should i just depend on the user to input the data into the subform.


Joso
 
Last edited:
The point that Pat made in her first post is crucial.

One can not totally verify on closure simply because, in a sense, closure is a Null… it is just an known.

The best I think you can do is push verification, as far as you can, into the time frame that the verification is required. That means doing it just before verification is required and not immediately afterwards.

The afterwards of verification is not known whereas the prelude of verification is known. In fact, if we don’t get past the prelude of verification it should not be verified and must not be processed.

So in a sense data should be verified immediately prior to usage, not some whimsically knowledge that the data may be correct from the last save.

For example (and not from database technology) a PID function in process control, that comes ‘on line’ must initialize itself to the current process and not to some saved past condition. (Those days have gone.)

The PID function must not assume the conditions of operation at the time, simply because it has no memory and the process is want to be fickle.

Therefore, conditioning of the algorithm is done by a live read at first call of the algorithm and not against some write that may or may not have been saved at last shutdown. That is the way it is done when things become crucial and if we think of our data as crucial then so be it.

The sixth normal form???…”Initialize from current process.”

Regards,
Chris.
 
I am wondering what would be my best bet. i validated everything i could possibly do as i used the mous trap sample on here with the save feature. This close or moving to a new record without subform information is the only problem.

Myabe i should change my design a little?

joso
 
Disable all close features on the OnCurrent event. Add a button to validate subform data. If data is sufficiently validated, enable all close features.
 
If you take a look at my db, you will see that i can't disable close features. The way i have it setup is a left join bringing all info from tblperson into tblclient, this allows me to add people (like doctors and business contacts names) from tblperson to become a client without adding the name again, just the client info. If i stop the user from closing, he/she would have to enter all the client info for everyone in tblperson, not everyone from tblDcotors and tblBusiness is a client.
 
i actually got what i needed to do. I used a query for the record source using a left join bringing all the records from tblperson to the other tables whether they are a client/doctor/business client or not. Created one form instead of using a subform, since it's a 1 to 1 relationship it worked well. If a user tries to create a new client, they have to fill out the evrything required. If the user just navigates through the records and sees the doctors name from tblPerson, the required fields are not required since it's not dirty. if the user does try to change the doctors name in the client form, then the other fields (unique to client) are required, so the user has to undo the changes then go into the doctors form to change anything.

tblPerson allows the user not to enter the name twice since everyones name from each type of person will show up in each form.

thanks for helping!
 

Users who are viewing this thread

Back
Top Bottom