Force user to make an entry on subform

ekta

Registered User.
Local time
Today, 02:53
Joined
Sep 6, 2002
Messages
160
Hi:

I have a combox on my form and if the user changes its value to "Active" or "Pending" a message box pops up that tells the user to make an entry in a subform.
This is the code that I have on the After_Update event of the combobox

If Me.NewRecord = False
If Me.Combo = "Active" or Me.Combo = "Pending" Then
MsgBox "Please make an entry in the Notes field", vbOKOnly
End If
End If

My question is that right now it just tells the user to make an entry in that field. I want to force the user to make an entry. There are 2 fields that the user needs to enter in-Notes and Notes Date-which are on a subform. I have 3 subforms that are on a tab control. I want to set focus on the Notes subform and lock everything else. Only when the user has entered data in these two fields they should be able to click anywhere else.

How can I do this? Sample db is attached.

Thanks,

Ekta
 

Attachments

Ekta,

Didn't look at your sample, but you need to do the following:

Me.YourSubform.SetFocus
Me.RequiredField.SetFocus

If you do that AND have the field's Required = Yes and AllowZeroLength = No,
then they will have to make the entry.

Wayne
 

Users who are viewing this thread

Back
Top Bottom