You can simplify your code as follow
thisform.text4.enabled = endinput.sales
thisform.text6.enabled = endinput.sales And endinput.hourly
if endinput.sales
if endinput.hourly
thisform.label3.caption = "SALES - HOURLY"
thisform.text6.setfocus
else
thisform.label3.caption = "SALES"
thisform.text4.setfocus
endif
else
thisform.label3.caption = "ADMIN"
thisform.text8.setfocus
endif
thisform.refresh
NODEFAULT
>>Hi Sergey
> I'm not sure of the syntax for using the NODEFAULT in my code. I have a method for the form which sets the focus to a control depending on the parameters I have outlined. The code is contained in a simple if..endif structure. I tried adding the NODEFAULT but received a syntax error.
>the code looks like this .
>
> if endinput.sales
> thisform.label3.caption = "SALES"
> if endinput.hourly
> thisform.label3.caption = "SALES - HOURLY"
> endif
> else
> thisform.label3.caption = "ADMIN"
> endif
> if endinput.sales
> thisform.text4.enabled = .t.
> if endinput.hourly
> thisform.text6.enabled = .t.
> thisform.text6.setfocus NODEFAULT ???
> else
> thisform.text4.setfocus
> endif
> else
> thisform.text6.enabled = .f.
> thisform.text4.enabled = .f.
> thisform.text8.setfocus
> endif
>thisform.refresh
>
>In the the control losing focus where you SET FOCUS.
>>
>>>>Hi Sergey
>>> Which code, the control receiving focus, or the control losing focus?
>>>
>>>Carmen
>>>
>>>Try to add NODEFAULT to your code. If it still doesn't work, post your code here.
>>>>
>>< snip >
--sb--