Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clearing Combo Box Choices
Message
De
30/04/1999 18:53:13
 
 
À
30/04/1999 08:11:57
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00211482
Message ID:
00214164
Vues:
38
Hi Cetin --

I don't know where to begin> THANK YOU VERY MUCH -- for putting so much thought and time into your reply. If we lived closer I would certainly hop in my car and drive for hours to take you out to the finest restaurant in your hometown!

I followed your entire note. The SQL section of your note is going to take a little getting use to at first, but I feel confident I will get it. Your idea at the very end of the note makes perfect sense to me. I understand that completely. I think this way I am utilizing the true power of the search form, b/c it has already identified the office.

I followed your instruction and placed my "officeid" field ( from my p-view used to populate my last combo), into column number 2 of my office_titles combo box. This combo box is the last one on my search form, which indicates the name of the office. Do not be confused by the title. I wanted to name it something other than offices, so I chose office_titles.

Let me back up even farther, so you know how I created my combos. I created p-views to pull data for my combos. Currently, my row source for combos 2-6 contain a p-view in their row source, followed by one field in the view -- the name. I want to let you know I only have one column in my combos, which calls the "names", not id's, as the VALUE. I tried for a week to reference id numbers and still have the name pop up in the combo, but came up a little short. Therefore, I decided to take the second column id out and just call the name for the value. It is a long story, but the fundamental problem I had with calling the id associated with the name is that if I called the id number, the user couldn't see the text. So, the user would click on a combo and just see a number.... which is useless.
___________________________________________________________________________

The rowsource for my last combo box (office_titles) looks like this:

officetitle_search_pview.ctitlename

After reading your message, I went into the rowsource of this combobox and added "nofficeid", and created a second column. My p-view contained this field, which was good.

I tested the combo and it worked fine. When a user clicks the combo box, after choosing VALUES in the first 5 combos, he/she might see this for example:

PRESIDENT - 10 && I understand I can hide this, I just haven't done it yet. I will after I get the OFFICES form to fire. For the time being I am keeping it visible. This is great.... Record number 10 back in my OFFICES FORM is the correct office I have selected with the combos. Record 10 matches my locality, district, and office -- PERFECT!

________________________________________

OK -- > the code

you wrote:

with thisform.cmboffice
myofficeId = .List(.ListIndex,3)
endwith

if !empty(myofficeid)
do form OFFICES with myOfficeId
endif

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

That code would translate into (tell my if I am wrong!):

WITH thisform.cmbofficetitle_search && this is the actual name of my 6th combo box. I am very certain this line is correct.

OFFICES.nofficeid = officetitle_search_pview(nofficeid,2) && Here I set the field in my OFFICES form equal to the rowsource of my 6th combo. officetitle_search_pview is the name of the view fueling cmbo #6, "nofficeid" is the index, and 2 is the column number. I interpreted ".list" to be refering to the rowsource of the combo box, and ".listindex" to be refering to the field name used to create the second column in the combo.

ENDWITH

IF !EMPTY(OFFICES.nofficeid)

DO FORM OFFICES with OFFICES.nofficeid

ENDIF


____

How does that look?

One problem is that the second column of my 6th combo is not a character value, it is numeric. You said I would have to change that to a character value with some sort of conversion. Could you assist me with the conversion? If so, I think that is the final piece of the puzzle!

I can then throw this code into the CLICK () of the search form and break open a nice bottle of wine!!


Thanks Cetin

Jason
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform