Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange Combobox behavior
Message
From
01/03/2000 15:05:30
 
 
To
01/03/2000 14:05:22
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00339984
Message ID:
00340034
Views:
21
>Hi All,
>
>I have a combobox class with the following code in the Refresh of the class:
>IF PEMSTATUS(ThisForm,"FormState",5)
>   This.Enabled=.F.
>   IF ThisForm.FormState > 0
>      This.Enabled=.T.
>   ENDIF
>ENDIF
>
>Formstate is a property I use on the Form to determine whether it's being edited or not. Anyway, in one instance, the source is constantly being requeried during an edit. In the Refresh of that instance, I have
>IF opgType.Value = 0 OR opgGroup.Value =0
>   This.Visible=.F.
>   This.Parent.lblBenefitPlan.Visible=.F.
>ELSE
>   This.Visible=.T.
>   This.Parent.lblBenefitPlan.Visible=.T.
>ENDIF
>DODEFAULT()
>When the program hit's the DODEFAULT() after reverting (in which the source table has been requeried again and had no records) I get a record out of range error. Now, there are no table references in any of the code, at the class level and in the instance. And the error highlights the DODEFAULT() but gives no indication WHAT in the default class code is erroring.
>
>Any ideas?

John,

Does the fact that you are always Enabled=.f. and then Enabled=.t. in the refresh cause this problem? I mean, is the fact the Enabled somehow forcing the refresh to re-execute or something? Wouldn't it be better to only Enable/Disable as needed with:
IF PEMSTATUS(ThisForm,"FormState",5)
   This.Enabled=(ThisForm.FormState > 0)
ENDIF
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform