Make a form Dirty on Open

mstorer

Registered User.
Local time
Today, 08:35
Joined
Nov 30, 2001
Messages
95
I have two programs:

Program1 is a system from an outside vendor. This program is a comprehensive insurance rating system which stores very detailed information about each policy in a DB2 Database.
Program2 is our program into which supplemental information not found in Program1 is entered. The data are stored in our own DB2 database.

Program2 queries data from Program1 and displays the appropriate information on several forms and allows the user to enter supplemental information and store it in our own tables. Clearly, the trick in developing Program2 was ensuring that the information in our vendor's tables and our own tables would match. Therefore, I somewhat mirrored their key structure in my design.

I have four tables, each corresponding to it's own form. Table 1 is the parent while 2-4 are the child tables. I query the keys of the vendor's program and have those as default values on my form to be then saved in my own tables. The issue is that it is possible for the user to advance in the program without entering supplemental data into the first page. This is not the norm, but can happen as our program performs a multitude of calculations and the user my simply want to see some information that exists further into the program, and may then type something

The question is: How to I make a form Dirty upon opening so that I will ensure that the keys are being written to the parent table. I have tried to save the record before the user advances, but I am finding that unless the form is dirty, not even the default values are stored.

My apologies for the long narrative. But I figured the question, "Why would you want to make a form dirty if no data is entered?" would be asked. Thanks for any assistance.

- Matt
 
Thanks for the reply Pat and sorry for the delay as I was down with the flu. Very true that what I propose is not a very efficient way of going about things. That stems much from the evolution of the program as our managers thought of extraneous uses for the program that fell outside the scope of the original plans. In order to please the brass, we ended up allowing for more unstructured movement though the program which could allow for a user to try and enter data in a child table before the parent has its entry. As we are enforcing RI though DB2, the users are getting the appropriate RI error if this scenario happens. When all is said and done, each of our tables will have data entered in them.

So I suppose my question my be more simply put, how do I save the default values of a form, in my case the keys of the parent table, without making the form dirty first?
Or is there some code that can be placed in the On Open event that says something like: Dirty = True? Thanks.

- Matt
 
Thanks Pat. If I couldn't find a way to save my default values I was planning on making one of the fields on the first form mandatory. Thanks for your assistance and guidance.
 
Huh...this code with "Before Insert" helped me solve the Form - subform - subform problem I posted a thread about last night.

Instead of automatically populating the ID fields to maintain the relationship, it forces the user to enter information in the right places first.

It isn't what I wanted, but is an elegant fix that solves the problem.

...and you guys didn't even know you were helping me.
 

Users who are viewing this thread

Back
Top Bottom