On not filling a text box of a field that is madatory in the database i want to throw a error message to user and set the focus to that particular Text box
Please help me in setting focus to that particulat text box.

Private Sub Form_Error(DataErr As Integer, Response As Integer)
Select Case DataErr
Case 3314
    
    MsgBox "A required field is blank.", vbCritical
    Response = acDataErrContinue
End Select
End Sub

Regards
Jagadeep Reddy

Hi,
If you are using access you have to include the code in the before_update event of the text box.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.