T
The Old Guy
You folks have always been there in the past with the right answer and I hope
you can help again. I'm trying to stop processing when a NoMatch condition
is encounterd, redirecting the focus back to the input text box. I'm lost.
Any help??
thanks in advance.
Private Sub Text6_AfterUpdate()
Dim rs As Object
Dim MsgA, StyleA, TitleA, Response
MsgA = "Item Not Found! Verify and re-enter." _
'-----------------------------------------------
'text6 is the input control for the item number
'-----------------------------------------------
StyleA = vbOKOnly + vbExclamation
TitleA = "Item Data Error"
'checking for an empty text block
If IsNull(Me.Text6) Or Me.Text6 = 0 Then
Exit Sub
End If
' Find the record that matches the control.
Set rs = Me.Recordset.Clone
rs.FindFirst "[Item] = '" & Me![Text6] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
If rs.NoMatch Then
If MsgBox(MsgA, StyleA, TitleA) = vbOKOnly Then
'this is where I'm stuck. how do I get the focus sent
'back to text6? everything I try still ends up with the
'cursor going to the next control. this code finds the
'inventory item as long as there is a match. I know
'the solution is probably simple, but then again, I'm
'teaching myself how to work with access.
End If
End If
End Sub
you can help again. I'm trying to stop processing when a NoMatch condition
is encounterd, redirecting the focus back to the input text box. I'm lost.
Any help??
thanks in advance.
Private Sub Text6_AfterUpdate()
Dim rs As Object
Dim MsgA, StyleA, TitleA, Response
MsgA = "Item Not Found! Verify and re-enter." _
'-----------------------------------------------
'text6 is the input control for the item number
'-----------------------------------------------
StyleA = vbOKOnly + vbExclamation
TitleA = "Item Data Error"
'checking for an empty text block
If IsNull(Me.Text6) Or Me.Text6 = 0 Then
Exit Sub
End If
' Find the record that matches the control.
Set rs = Me.Recordset.Clone
rs.FindFirst "[Item] = '" & Me![Text6] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
If rs.NoMatch Then
If MsgBox(MsgA, StyleA, TitleA) = vbOKOnly Then
'this is where I'm stuck. how do I get the focus sent
'back to text6? everything I try still ends up with the
'cursor going to the next control. this code finds the
'inventory item as long as there is a match. I know
'the solution is probably simple, but then again, I'm
'teaching myself how to work with access.
End If
End If
End Sub