Hi,
Closing the current form will not work with this event. Period!
There is two ways of doing this.
1. Use Macros - bind it to the lost focus property field.
2. Use the form's timer event and interval.
Note: Personally, I do not like this method myself. But it work.
Closing the current form will not work with this event. Period!
There is two ways of doing this.
1. Use Macros - bind it to the lost focus property field.
2. Use the form's timer event and interval.
Tried it.. whew what the heck.. Here is the code I am working with
Private Sub SFVINFen_GotFocus()
If Me.SFVINFen.ListCount = 0 Then
If MsgBox("VIN Does Not Exist! Would You Like To Continue With The New Order?", vbQuestion + vbYesNo, "VIN NOT FOUND!") = vbNo Then
Exit Sub
Else
Dim stDocName As String
DoCmd.OpenForm "Order Details", acNormal
DoCmd.GoToRecord , , acNewRec
Forms![Order Details].VIN.Value = Me.VinToFindFen
Forms![Order Details].ROFirst.Value = Me.FirstNameToFindFen
Forms![Order Details].ROLast.Value = Me.LastNameToFindFen
End If
Docmd.Minimize 'minimized for effect
Me.TimerInterval = 1000 ' set the timer
DoEvents '
End If
End Sub
Private Sub Form_Timer()
'close the form here
DoCmd.Close acForm, "frmNewOrdeVINVerify"
End Sub
Keep in mind this control is on the form that i want to close...
SFVINFen
Fen How
Note: Personally, I do not like this method myself. But it work.
Last edited: