Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IF STATEMENTS

Status
Not open for further replies.

Muzzy

Programmer
Dec 14, 2001
68
GB
Here's the problem: I have 4 command buttons on a main form. what happens is that on a main form I have sub forms that open on a click of these command buttons, when data is added in the sub form I close it and disable the cmd button on the main form so no more data can be added to that particular subform. I have to shift the focus to the next button to be able to disable it.

if I try to shift it to cmd2 and this is already disabled then I get an error. I need to say something like:
if cmd2.enabled = false
then do.cmd.gotocontrol"[cmd3]"
else do.cmd.gotocontrol"[cmd2]"
If cmd3enabled =false
then do.cmd.gotocontrl"[cmd4]" and so on
But command buttons 2+ 3 might be disabled so I'll have to go to button 4.
Any help would be greaatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top