R
Rémi
Morning all. I'm seeing something really strange on a form I'm
reviewing, wondering if anyone can offer any suggestions. Access XP/
Windows XP.
I'm opening the form to add a new record with:
DoCmd.OpenForm "frmInventoryItem", _
DataMode:=acFormAdd, windowmode:=acWindowNormal
Only one field on this form is required. If I enter the required
field, everything happens as I would expect. If I do not fill it in,
then:
* If I close the form by clicking on the "x" in the upper right
corner, I'm prompted twice: once that "The field 'BLAH' cannot contain
a Null value because the Required property for this field is set to
True.", and once for "You can't save this record at this time.
* BUT if I close the form by clicking on my "Close" command button,
no warnings or error messages come up, and the form simply closes
without providing any cue that something was wrong. This is the whole
of my close button's click event handler:
Private Sub cmdClose_Click()
DoCmd.Close
End Sub
I've tried sticking a breakpoint in Form_Error, but it doesn't seem to
fire either.
I have made the form's autonumber field visible, to see if it provides
any clues as to what's happening... As soon as I enter any optional
field, it gets assigned a value (as expected). But when I click the
"Close" button, it reverts to "(Autonumber)" once again.
Frankly, I'm at a bit of a loss - the only thing I've been able to do
is force a Refresh in cmdClose if the form is Dirty - which does
provide me with an error if the required field isn't filled out, as I
would hope.
Am I missing something obvious here? Anyone seen this before?
Regards,
Remi.
reviewing, wondering if anyone can offer any suggestions. Access XP/
Windows XP.
I'm opening the form to add a new record with:
DoCmd.OpenForm "frmInventoryItem", _
DataMode:=acFormAdd, windowmode:=acWindowNormal
Only one field on this form is required. If I enter the required
field, everything happens as I would expect. If I do not fill it in,
then:
* If I close the form by clicking on the "x" in the upper right
corner, I'm prompted twice: once that "The field 'BLAH' cannot contain
a Null value because the Required property for this field is set to
True.", and once for "You can't save this record at this time.
* BUT if I close the form by clicking on my "Close" command button,
no warnings or error messages come up, and the form simply closes
without providing any cue that something was wrong. This is the whole
of my close button's click event handler:
Private Sub cmdClose_Click()
DoCmd.Close
End Sub
I've tried sticking a breakpoint in Form_Error, but it doesn't seem to
fire either.
I have made the form's autonumber field visible, to see if it provides
any clues as to what's happening... As soon as I enter any optional
field, it gets assigned a value (as expected). But when I click the
"Close" button, it reverts to "(Autonumber)" once again.
Frankly, I'm at a bit of a loss - the only thing I've been able to do
is force a Refresh in cmdClose if the form is Dirty - which does
provide me with an error if the required field isn't filled out, as I
would hope.
Am I missing something obvious here? Anyone seen this before?
Regards,
Remi.