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:
00503764
Vues:
18
Sometimes 36 holes of bad golf is worth that one birdie... :)



>I set the cbo.rowsource to 'Masterstats.reqt_name' and reset all of the values in the interactive event like you suggested and now it is working like a charm!! Thank you so much for all of your help!!! :)
>
>============================================================================
>
>>>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!! :)
>>
>>Think I can. Try setting the cbo.controlsource to 'Masterstats.reqt_name'.
>>Also, since you are setting only the value and not the controlsource of the other controls, you would need to reset all those values in the cbo interactivechange not just thisform.refresh(). Refresh would work if the controlsource were set to a field or an expression that operates on a field.
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform