>Hi Sir,
>
>No, I am not adding table to DE. I am opening and closing my tables via codes.
>
>I have also just set my Data Session to PRIVATE. The AutoOpenTables and AutoCloseTables properties are set to .T. as default.
>
>What happens if I go to View - Data Environment and add a table to it? Can I take out the codes that I have put in in my combo box init? Please confirm.
>
>Thanks,
>Sam
I don't know what code you have in the combos' .Init() but, if that's the code top open the tables AGAIN and all that then, yes, you don't need it. That's the "visual" part of VFP - obviating the need for much of the mundane code like this.
However, in the DE you can give all your repeat tables their own alias, and use the alias as combo's RowSource.
e.g. you've added Customer table to the DE 5 times, one for each combo. You alias them Customer1, Customer2 ... 5.
Customer1..5 becomes the RowSource alias for each of the 5 combos.
BTW, if you had built your combos via the control builder right-click on a control you've added to the form, then each invokation of the builder would have added the table again to the DE.
HTH
Terry
>
>>Are you adding tables to the Data Environment (dragging them from your database lists >into the DE window?) or opening and closing all tables via code? If the latter then >you're missing out on much of the beauty of using "visual".
>
>>In the DE, you set a property of Private Data Session, equiv. to Open ... AGAIN (which >you learned earlier).
>
>>Also you can set the DE's AutoOpenTables and AutoCloseTables properties.
>
>>So set these, drag your required tables into the DE (in the earlier example you could >have dragged several copies of the table into the DE, one for each combo), then forget >about them.
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.