I worked on correcting the master record in the second window today. Master records for both the main form and the second (notes) form should be the same. What is a master record? The one that any child records link to. If the form is a browse form (multiple records in a detail block) the master record is (in my designs) displayed at the top and the related child records are displayed in rows further down the page. In this case the main form displays details from the master record and the second form displays notes related to the master record, with a few identifying items from the master record displayed at the top.
I had both forms displaying yesterday, but the master record data was not always the same (synced) as I wanted. Today I tried to resolve that. I discovered I was not using the same datasource for both forms, which was why some master records could not sync. Each form has a built-in datasource for each file that is saved in the form by the Forms Designer. In my program I am supposed to override that definition, by opening the file (datasource) before I open the form. In the second form, I was not doing that, so the form used a small test file in different directory to load the master table. The records in that table did not always match those in the master record on the main form.
I spotted the difference in the master tables because of some code that checks record count for that table. I noticed only 6 records in the master table for the second form. I knew there were over 1000 records in that file, so I went looking for what could cause the difference and confirmed I was not opening the master table for the second form.
I also had a note from the SIMPOL tech support that I did not need to perform a selectkey operation on the second form's master table, but should be able to copy the master table object and master record object from the first form into the second. I went back and changed that code accordingly. After a bit of tinkering, I was able to confirm that the second forms master record contained the right data. Whenever I am in doubt as to what is going on, I can usually use the object browser, built into developers IDE to check the value of various objects. Unfortunately I cannot check the value of a record's fields with it. Fields must be run through a function to convert them into a readable format. In these cases, I place statements in the code to convert the field values into a string, number, or date that I can see in the variables watch panel. The statements are just there to help me when debugging. Using these statements, I could tell that the correct master record was being used in the second form.
Unfortunately, I am unable to see the form now as a program crash is occurring after my code has finished. It is one of those cases where an error is occurring beyond the reach of my debugger. I have the source code for just about all the furnished libraries, so I can debug into the them, but the function where the error occurs is not among the source I have in the project. I prepared a sample project demonstrating the error and shipped it off to my SIMPOL tech support contact. Neil has been very helpful with these issues where I cannot debug the code for lack of source, and I try not to give him anything until I have exhausted my abilities. I'm sure he will be able to find the problem soon.
In the meantime, I can make preparations to install Linux in a virtual machine on my computer so that I can start testing the code on a second operating system.
-djinks Apps and Services: www.jinksinc.com