Correct Event for code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. I have code that is working, although a bit too aggressively! My
message box pops up before the poor user even has a chance to make entries in
the form.

I need to make sure that one of my keys gets populated before the user moves
to a subform, since the subform is based off a CPK that includes the first
key. Anyway, once the user decides to add a record, before the user can even
enter the VolunteerName, my code pops up telling them to enter the
VolunteerName. Not too friendly. I can either trigger code too early or too
late! Suggestions about the correct Event trigger and the following code?
Thanks.

Private Sub Form_Current()
Me.VolunteerName.Requery
Me.VolunteerName.SetFocus
If Len(Trim$(Me.VolunteeringID & vbNullString)) > 0 Then
Else
MsgBox "Please enter a 'Program Name'!", vbInformation, "Enter Program
Name"
Me.VolunteerName.SetFocus
End If
End Sub
 
Back
Top