Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clearing Combo Box Choices
Message
From
06/05/1999 12:28:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/05/1999 21:19:26
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00211482
Message ID:
00215768
Views:
53
>Hi Cetin - I was actually relieved this evening when I logged on to UT and their was not a reply from you, regarding my last post. Here is why>>>
>
>I figured out the problems to my 2 questions I asked you in my last post!
>
>Question A, dealt with not having duplicate values appear in my officetitle combo box. I read in VFP HELP how to deal with this issue. I went to the Miscellaneous tab in the view designer and selected no duplicates and overwrote the SQL statement. And it works perfect. I ran some test data and selected a locality (city) that I knew had multiple "presidents", and only one showed up in the drop down. Then, the user can go to the last combo and select the district to find the specific office (president) he/she wants.
>
>
>Question B, dealt with placing code in the cmd button to check combo box 6 (district combo) for a value. If there is a value in that combo, than the code is executes. If there is no value, the code looks at combo number 5 and takes the "nofficeid" value and opens the OFFICES form.
>
>The new code looks like this:
>
>with thisform.cmbjurisdiction_search
> m.myofficeId = val(.list(.listindex(2))
>endwith
>if !empty(m.myofficeid)
> do form offices with m.myofficeid
>else
> with thisform.officetitle_search
> m.myofficeId = val(.list(.listindex(2))
> do form offices wiht m.myofficeId
> endwith
>endif
>
>________________________________________
>This code works great.
>
>________________________________________
>
>It's done!
>
>*** One concern:
>
>When I go to click on my offices form to do data entry, I can no longer access it. I get an error message. If I go into it and take out the code placed into the INIT(), I can do data entry. After I am done with the data entry, I go back and re-set the code.
>
>I believe this has to do with data sessions, but I am not sure? Honesty, I do not understand data sessions, or how to set them up. I am going to have to read about that -- soon!
>
>If you have any thoughts on why this is occuring and how I can alleviate this, I would sure love to hear your insight.
>
>
>Once again Cetin.. thanks for your help and encouragement.
>
>
>Jason
Good solved a lot :) For first I would say add "distinct" in SQL but wouldn't remember its corresponding "no duplicates" option in designer (you see I'm lack of designers). BTW if you know something is doable in Access I believe it's "certainly" doable in VFP (some might not be as easy as they're there - Access is not step child :).
For second I think there's a typo in code you pasted but believe you use the correct one.
m.myofficeId = val(.list(.listindex,2))
I couldn't understand how one would distinguish correct office_title when there is more than one and based on district. If I were you I would use only one combo instead of combos 5 and 6. One combo would show both district+office_title and keep nofficeid. Its SQL would look like :
select district+office_title, nofficeid ;
  from districts ;
    right join offices ;
    on districts.dsId = offices.ofId
"Right join" :) This would also pull offices which have no district as null, remember. This SQL would in fact follow up our bigger SQL, just would use "right join" at district-offices connection. Or since we dropped it could be just one SQL added a
 ... ;
  where district.localityId = thisform.cmbLocalities.list(thisform.cmbLocalities.ListIndex,2)
Provided localities combo has a second column holding "Locality id".
Honestly I would do this way but wouldn't touch "working code" till I know what I'm doing :)
Assuming you already set datasession to private, I would say :
set exclusive off
set multilocks on

Datasessions are like slots of data environments not directly interacting with each other.
Suppose you have 5 different forms all with datasession set to private. In all forms you open same series of tables. With "privacy" :
You would move record pointer in a form w/o effecting others :) Cool.
When you close or open table(s) in one of them that wouldn't effect the others too :) Cool.
Even more, when you do a select into cursor, cursor would belong to its form's data slot :) Cool.
Advanced : You could visit any form's data slot :) Cool.
Very similar to "use again in 0" but also you don't hack with "close tables" when you issue on a form or close the form itself (only its data slot is released).
Not very technical explanation but might lead you to understand it. A very simple sample illustrating this is in "solution.app" (samples directory) as "Multipl instances of a form" or something like that. Yeah multipl instances of the same form running and rec. pointers moving freely in each :) Multiuser on a single machine :)
Your user's wouldn't need to close the one they opened, to search and edit another office :) Although there the main purpose was "not to hack with current data environment".
PS: If you could zip and email the project with some data (not need to be real), I could more easily see what's going on :) (For email adress just click the envelope icon). Data and design would be kept confidential:) But as in some offices this is not possible to do I understand it and could continue this way.
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