Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating form when combo box is changed
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00503574
Message ID:
00503700
Vues:
16
Below is how I populate all fields on the form....
&& populate fields from Masterstats cursor
SELECT MASTERSTATS
GO TOP
ThisForm.cboRequirement.ControlSource = 'Masterstats'
ThisForm.cboRequirement.ColumnCount = 1
ThisForm.cboRequirement.RowSourceType = 6
ThisForm.cboRequirement.RowSource = 'reqt_name'
Thisform.cboRequirement.Value = Masterstats.reqt_name
ThisForm.cboProbeType.Value = Masterstats.probe_type
ThisForm.lblGain.Visible = IIF(ThisForm.cboProbeType.Value='LVDT', .t.,.f.)
ThisForm.txtGain.Visible = IIF(ThisForm.cboProbeType.Value='LVDT', .t.,.f.)
ThisForm.txtGain.Value = IIF(ThisForm.cboProbeType.Value='LVDT', Masterstats.gain,'')
ThisForm.txtChannel.Value = Masterstats.channel
ThisForm.txtCard.Value = Masterstats.card
ThisForm.txtProbeSN.Value = IIF(ThisForm.cboProbeType.Value='DP',Masterstats.serial, '')
ThisForm.txtFullScale.Value = Masterstats.counts
ThisForm.txtStroke.Value = Masterstats.stroke
ThisForm.txtStdOffset.Value = Masterstats.std_offset
ThisForm.txtStdVar.Value = Masterstats.std_var
ThisForm.cboUnit.Value = IIF(llInches,'IN','MM')
And based on your email below I just put the following code in the Interactive Change event of the cbo box...but it didn't work:
lcCurrentRec = recno()
select masterstats
go lcCurrentRec
ThisForm.Refresh()
Hopefully you can help!! :)


===========================================================================
>>I have created a form that is populated from the INIT event. The objects on the form are populated from a temp cursor. I have a combo box on the form that is populated by a column in the table. This way the user can choose a different requirement...when they do, I want it to refresh the whole screen to reflect the data from the new record that was selected. I have tried putting Thisform.Refresh() in the Interactive Change event of the Combo Box as well as in the Valid and LostFocus events. None of these seem to be refreshing the screen.
>>
>>Could someone shed some light on this subject for me...
>>
>>Thanks!
>
>I'll need to know how the cbo is populated from a column. Based on that there may be several solutions to get the result you want but basically it amouts to grabbing the recno() in the interactivechange of the cbo then select the cursor go record then refresh the form.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform