Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo will not display value after closed
Message
From
28/05/1999 04:48:19
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
27/05/1999 15:22:13
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00222776
Message ID:
00223847
Views:
19
>Hi Jim
>
>It has been very nice of you to help me. I thank you very much.
>
>I have some good news and bad news! The bad first: The code you provided me was unsuccessful in getting the combos to display after closing the form. I did learn from it, but it didn't work. I will definitely use it in the future.
>
>The good news is, I believe I am on the right track to solving this little problem. I posted a question last night that John Koziol helped me tremendously with. He said, when the form is being closed and open, the views are being reset, which is why it returns no display to the combo box.
>
>He said to open the views in the default datasession and not at the form level.
>
>
>That is the answer, I believe, it is just a matter of doing it. It sound very simple, but I am a junior developer! No step is a "gimmee putt" for me!!
>
>What confuses me is why if I place a "regular view" into the rowsource of a combo box, it works fine. It only caused me aggravation with a pview.
>
>Now, when John says not to open the view at the form level, how does that happen? I know I can go to my PEM sheet and set the form to default datasession.... is that what he is referring to. Isn't that at the form level?
>
>I noticed when I went to the data environment of my pview in the form designer, there was no PEM for datasession for the pview.
>
>I know this may be very simple, but how does this occur? ... setting the view to a default data session and not openig view at the form level?
>
>I look forward to hearing back from you. Unfortunately I can't stay on line right now b/c I have to run to a meeting, but I will be back to work on this later tonight.
>
>Thanks for the help.. and I hope I am not asking such an easy question that it is ridiculous. Unfortunately, I am "it" for FoxPro at our small company and w/o the UT to teach me, I would be at a loss. This thread has helped me more than words can say.
>
>Thanks
>
>Jason
Jason,
This is what I was trying to tell you from the beginning with my "fantastic" English :)
Combos could be mind confusing, worse pviews are complex to handle at first.
I repeat :
A combo would show a value only if it has the value on its available items list.
Numberofelements is another cause but with "Fields" setting is not an issue here.
Pviews are kind of SQL that change content based on parameter.
So on entry to form with the parameters supplied to pviews, combos might not have the value yet.
That's why I told you :
Place "select * from pview1..select * from pview2" in form init to check it.
I again suggest :
-Replace rowsourcetype with SQL - .Rowsourcetype = 3
-Set rowsource to SQL - "select ... from ... into cursor myCursor1"
-In gotfocus of combo requery combo which would correspond to requerying view - this.requery()
If all this fail (with SQL there is a major cause to fail - unupdated data) then we should check this again.
Setting SQL for rowsources is not hard :
Open your view in designer, view SQL, copy, add " into cursor crsName" at the end, quote it and place in combo.init :
lcSQL = %CopiedPastedSQLFromDesigner%
this.rowsourcetype = 3
this.rowsource = lcSQL
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform