jlathem
Technical User
- Jul 25, 2010
- 27
Hey Guys,
I am having a problem with SetFocus.
What I am trying to do is check to se if the control Payee_ID is Null, if so give a MsgBox and SetFocus back to the Payee_ID control.
When I run the code below, I get the MsgBox and the curser blinks once or twice in Payee_ID before moving to the next tab stop.
Any suggestions?
Thanks,
James
I am having a problem with SetFocus.
What I am trying to do is check to se if the control Payee_ID is Null, if so give a MsgBox and SetFocus back to the Payee_ID control.
When I run the code below, I get the MsgBox and the curser blinks once or twice in Payee_ID before moving to the next tab stop.
Any suggestions?
Thanks,
James
Code:
Private Sub Payee_ID_LostFocus()
'Declare page variable
Dim var_NullCheck As Currency
'Check to see if user entered Payee_ID, if not give message.
If IsNull(Payee_ID) Then
MsgBox "You must enter a Payee ID to continue." & vbCrLf & " " & vbCrLf & "Please Try Again.", vbExclamation
Payee_ID.SetFocus
Else
'Find the DSum of all Rendering Provider's Total_Claims_Paid
'If all Total_Claims_Paid values are Null replace with 0
Me.Thirteen_Week_Average = Nz(DSum("Total_Claims_Paid", "Payee_Rendering_Claims_Data", "Payee_ID =" & Chr(34) & [Payee_ID] & Chr(34)), 0)
'Find the Payee's Name form the Form's Payee_ID
Me.Payee_Name = DLookup("Payee_Name", "Payee_Rendering_Claims_Data", "Payee_ID =" & Chr(34) & [Payee_ID] & Chr(34))
End If
End Sub