Skip logic problem

rodmc

Registered User.
Local time
Today, 12:26
Joined
Apr 15, 2010
Messages
514
Hi Folks

doing a bit of skip logic an TBH I thought it would be straight forward until I hit the following problem. Say someone selects an answer from a combo (say Yes or No in this case), yes in the after update locks down/disables the comment box underneath said question and sets focus to the next question and No sets focus to the comment box and enable = True. This all work fairly well using the code below UNTIL someone changes their mind and want to change the answer they have selected from the combo, the I get "unable to set focus" becuase select yes for example locks it down.

Code:
If cboQ14 = "Yes" Then
        Me.cboQ15.SetFocus
        Me.txtQ14b.Enabled = False
        
    Else: Me.txtQ14b.Enabled = True
    End If

What have I been doing wrong here?
 
In theory the code below should do what you want:
Code:
If cboQ14 = "Yes" Then      Me.cboQ15.SetFocus      Me.txtQ14b.Enabled = False Else
     With Me.txtQ14b
         .Enabled = True
         .SetFocus
     End With
End If

If this code does not work then you need to check to see what value is being returned by cboQ15.
 
Cheers Mr B, I will change accordingly!
 

Users who are viewing this thread

Back
Top Bottom