Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with Combobox with SQL as rowsource VFP5.0a
Message
De
02/01/2000 15:39:52
Carol Adler
U.S. Army Kwajalein
Apo, Iles Marshall
 
 
À
02/01/2000 02:56:57
Carol Adler
U.S. Army Kwajalein
Apo, Iles Marshall
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00311307
Message ID:
00311407
Vues:
16
>I have the parent table Travel_Orders with foreign keys pointing to the child tables, Entry_Exit_reason and HRO_reason.
>
>The child tables are the same structure, and there are two because the lists are "owned" by two different departments: The major fields are the travel reason, whether it is on or off-island travel, and the primary key.
>
>On the form, there is an option group, and two drop-down combo boxes. I am "sitting" on the parent, Travel_orders.
>
>When I click on the option button group, it is to determine if the travel is OFF or ON island, and if the user is changing their choice. If it is a change in OFF or ON, the child keys in the parent table is emptied. A SQL Select statement is issued for the rowsource in the comboboxes into a cursor.
>
>My problem is that the correct child key is stored in the parent table, but the relationship is "stuck" to the cursor. If I print the order without getting off the record, I print the old values because the parent/child relationship has not been updated. Once I click the "next" navigation button and then the "prev" button, all is well. However, I'm having quite a problem "refreshing" programatically.
>
>I will be happy to send more information if anyone is interested in helping me out on this one.

Here is further information:

This is the code in my option buttons. To make a long story short, all I need to do is "refresh" the data environment or do something to fake it out that I have moved off and back onto the record. I tried Thisform.refresh, skip -1 and skip 1, trying to lock the screen then click on the next button. Nothing works unless I physically click on the pageform or the next and previous buttons, then the data environment refreshes correctly.

WITH THISFORM.mybasepages1.page1
IF .MyOptionGrp1.Value = 2 and Thisform.r_onoffcode != 2
REPLACE travel_orders.hro_code with ""
REPLACE travel_orders.ee_code with ""
.cboReason1.RowSource = "SELECT travel_reason,ee_code from ;
entry_exit_reason WHERE on_off = 'OFF' ;
into CURSOR cur_eereason"
.cboReason2.RowSource = "SELECT travel_reason,hro_code from ;
hro_reason WHERE on_off = 'OFF' ;
into CURSOR cur_hroreason"
ELSE
IF .MyOptionGrp1.Value !=2 AND Thisform.r_onoffcode = 2
REPLACE travel_orders.hro_code with ""
REPLACE travel_orders.ee_code with ""
ENDIF
.cboReason1.RowSource = "SELECT travel_reason,ee_code from ;
entry_exit_reason WHERE on_off = 'ON' ;
into CURSOR cur_eereason"
.cboReason2.RowSource = "SELECT travel_reason,hro_code from ;
hro_reason WHERE on_off = 'ON' ;
into CURSOR cur_hroreason"
ENDIF
.cboReason1.Requery
.cboReason2.Requery
ENDWITH

Thisform.r_onoffcode = This.value
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform