>Briefly, I decided today that the solution to a problem I was having with one form calling another was to use a private data session in the called form. So today I'm learning about forms, data sessions, and dataenvironments. I hope.
>
>Here's something which surprised me:
>I created a form from VFP CREATE FORM command (i.e. it's not based on a subclass). I kept everything default except the form name, and added WAIT WINDOWs to all the Events to watch their firing sequence. I added one cursor to the data environment of the form, and put WAIT WINDOWS in all the events of the data environment and the cursor. I put a single button on the form, changed its caption to Close and its name to cmdClose, and added WAIT WINDOWs to all its events. Here's what surprised me. The event firing sequence at the start of the form went:
>Form.De.OpenTables
>Form.De.
BeforeOpenTables
>Form.Load ... etc.
>
>Now how does it make sense to anyone that the BeforeOpenTables event fires after the OpenTables event??? Yes, I triple-checked my WAIT WINDOW commands, and I have the correct strings in the correct events.
>
>Help? ... glub ... blub ... blub ...
> (drowning in new VFP knowledge)
Pick up a copy of
The Hacker's Guide to VFP 6, the authors did a tremendous job of documenting exactly what the relative firing sequences are (yes, DE.OpenTables fires first, but DE.BeforeOpenTables fires before it completes, prior to the first table actually being opened!)
It's worth every penny.
>
>Rich.