Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating form when combo box is changed
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00503574
Message ID:
00503760
Views:
15
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform