Required field errors in main form when clicking into subform

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

Guest

I get error messages when I click into my subform without completing all
required fields in the main form. I understand Access automatically saves the
current record in the main form when I move into my subform, however is there
a way of allowing me to save when I choose to ie. have a Save record button
on the main form.
 
I get error messages when I click into my subform without completing all
required fields in the main form. I understand Access automatically saves the
current record in the main form when I move into my subform, however is there
a way of allowing me to save when I choose to ie. have a Save record button
on the main form.

Sure; that's one of the options that the command button wizard
provides, or you can just set the button's Click event to

Private Sub SaveRecord_Click()
If Me.Dirty = True Then
Me.Dirty = False
End If
End Sub

However, this will NOT get around the fact that a required field is
still a required field. It doesn't matter if you save the record by
clicking a button, moving off the record, or setting focus to a
subform; the check will still be done. You can't have it both ways -
it's a required field, or it's not!

John W. Vinson[MVP]
 
Back
Top