Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

MsgBox after Lost Focus

$
0
0
So, I am noobing on! =)

After my textbox "CaseNumber" is losing focus, and if ISNull, then i want a msgbox to pop up and: "you have to type casenumber before you move on" and then set focus back at the casenumber textbox, so I avoid people typing in other stuff before they type in the casenumber...

I've tried this so far, but just got error runtime: 5

Code:

Private Sub txt_casenumber_LostFocus()

Dim lngsvar As Long

If IsNull(Me.txt_casenumber) Then
    lngsvar = MsgBox("Fill in casenumber first", vbCritical, vbOKOnly, "Please fill in?")
    If lngsvar = OK Then
    Me.txt_casenumber.SetFocus
    End If

   
End If


Thanks again =)

Viewing all articles
Browse latest Browse all 13329

Trending Articles