B
Bre-x
I have this code on a text box control (tfind) How come the focus does not
go back to it? It goes to the next control
There is something wrong with my code, but i cannt see it.
Thnks
Private Sub tfind_LostFocus()
Dim sqlstring As String, mymsg As String
If IsNull(Me.tfind) = True Then
Exit Sub
End If
Me.Mainsub.SourceObject = "Blank"
sqlstring = "SELECT count(*) as CC FROM BKARINV WHERE BKAR_INV_SONUM = " &
Me.tfind
CurrentDb.QueryDefs("DBA").SQL = sqlstring
If DLookup("[CC]", "DBA") = 0 Then
mymsg = "Sales Order: " & Me.tfind & " is not on DBA."
Responce = MsgBox(mymsg, vbCritical, " UMC")
Me.tfind.SetFocus
Exit Sub
End If
End Sub
go back to it? It goes to the next control
There is something wrong with my code, but i cannt see it.
Thnks
Private Sub tfind_LostFocus()
Dim sqlstring As String, mymsg As String
If IsNull(Me.tfind) = True Then
Exit Sub
End If
Me.Mainsub.SourceObject = "Blank"
sqlstring = "SELECT count(*) as CC FROM BKARINV WHERE BKAR_INV_SONUM = " &
Me.tfind
CurrentDb.QueryDefs("DBA").SQL = sqlstring
If DLookup("[CC]", "DBA") = 0 Then
mymsg = "Sales Order: " & Me.tfind & " is not on DBA."
Responce = MsgBox(mymsg, vbCritical, " UMC")
Me.tfind.SetFocus
Exit Sub
End If
End Sub