Thread: Events
View Single Post
  #2  
Old May 28th, 2004, 10:46 AM
Nikos Yannacopoulos
external usenet poster
 
Posts: n/a
Default Events

Kenny,

With your code as is, DoCmd.GoToControl will be executed if the value of
control Compilations is, literally, the word None. Is this what you mean, or
do you mean when the control is blank (no entry Null value)? In the latter
case, the If statement should be:

If IsNull(Me.Complications) Then

If, ineed, you meant the word None literally, then there can be one of two
things happening:
1. The value of Compilations is not exactly the same, i.e. "None"; if it is
a combo box, make sure the row doesn't have, say, a space at the end, which
you don't see, but returns the string "None " instead of "None"
2. There is a macro or code behind the On Enter or On Got Focus event of the
OrderRenewal control, that passes focus to RiskAssessment control instantly.

HTH,
Nikos

"Kenny G" wrote in message
...
Below is the code I currently have to either skip a control or go to a

control based on the response in the complications control. The problem is
even when Me.Complications is none the cursor goes to RiskAssessment.
What's wrong with my code?

Thanks in advance for your assistance.

Private Sub Complications_Exit(Cancel As Integer)
If Me.Complications = "None" Then
DoCmd.GoToControl "OrderRenewal"
Else
DoCmd.GoToControl "RiskAssessment"
MsgBox "Has A Risk Assessment Form Been Completed?",

vbInformation, "UHS"
Cancel = True
End If
End Sub

Kenny G