Lost Focus Event

S

SHIPP

I've got the following code. Everything works except setting the focus back
to the control I am trying to test. I would appreciate any help. I am working
with Access 97.


Private Sub WedForecast_LostFocus()


'***************************************************************************************
'* PROGRAM : PSI
'* CREATED : 6/28/05
'* COMMENTS : Recalculate beginning and ending inventories
'* PARAMETERS: -
'* CALLED BY :
'* MODIFIED :

'***************************************************************************************

On Error GoTo HandleErr
Const cstrProcName As String = "frmRoughCut - WedForecast_Exit"

Dim strMsg As String
Dim strOpt As String
Dim strTtl As String
Dim strRsp As String

Me.Dirty = False
Call CarryFwd
If Me.WedEndInv < 0 Then
Call ErrEndingInventory("Wednesday Forecast")
Me.WedForecast.SetFocus
End If
Me.Dirty = False


ExitHere:
Exit Sub

HandleErr:
Select Case Err.Number
Case Else
MsgBox "Error " & Err.Number & ": " & Err.DESCRIPTION, vbCritical,
cstrProcName
End Select
GoTo ExitHere

End Sub
 
A

Allen Browne

Use the control's BeforeUpdate event (or the Exit event if you want to run
the code even if nothing was changed), and cancel the event if you want to
stop the user from moving on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top