I have the following code:
For i = 0 To conMaxControls - 1
If f.Controls("cbxFld" & i).Enabled = True Then
If f.Controls("cbxFld" & i).Value = strcbxFld Then
f.Controls("txtVal" & i) = strKeyword
f.Controls("txtVal" & i).SetFocus
End If
End If
Next i
strcbxFld is a string earlier defined, and so is strKeyword.
The code works.
However, because the value of several cbxFld may be strcbxFld, running the code has the effect that for each i where cbxFldi is strcbxFld, the value of txtVali is set to strKeyword.
What I've been trying to do is to change the code in such a way that the value of txtVali is only set to strKeyword if txtVali is null.
But none of my attempts have been succesful up until now. Can anyone help me out?
For i = 0 To conMaxControls - 1
If f.Controls("cbxFld" & i).Enabled = True Then
If f.Controls("cbxFld" & i).Value = strcbxFld Then
f.Controls("txtVal" & i) = strKeyword
f.Controls("txtVal" & i).SetFocus
End If
End If
Next i
strcbxFld is a string earlier defined, and so is strKeyword.
The code works.
However, because the value of several cbxFld may be strcbxFld, running the code has the effect that for each i where cbxFldi is strcbxFld, the value of txtVali is set to strKeyword.
What I've been trying to do is to change the code in such a way that the value of txtVali is only set to strKeyword if txtVali is null.
But none of my attempts have been succesful up until now. Can anyone help me out?