H
hursty
I am making a defect tracking database and in one of the forms I want to keep
the date after they hit submit so that the person entering data doesn't have
to type in the date everytime. The text box is called EntryDate
So, to solve that problem I did one of these...
Private Sub Submit2_Click()
On Error GoTo Err_Submit2_Click
Dim savedate As Date
savedate = EntryDate
DoCmd.GoToRecord , , acNewRec
Me.EntryDate.SetFocus
Me.EntryDate = savedate
Exit_Submit2_Click:
Exit Sub
Err_Submit2_Click:
MsgBox Err.Description
Resume Exit_Submit2_Click
End Sub
I added the
Dim savedate As Date
savedate = EntryDate
Me.EntryDate = savedate
to the code so it would save the date.
This part of it works fine, however, now I have a new problem.
After submitting the last record, and hitting the 'X' to close, I get the
following error.
"The field 'Recrate Reason Table.Reason Code' cannot contain a Null Value
because the Required property for this field is set to True. Enter a value in
this field"
I still want Reason Code to be required for all the entries but I don't want
this message to pop up everytime.
So I tried to figure out some sort of delete record command on Form_close
but it was to no avail.
Please Help
the date after they hit submit so that the person entering data doesn't have
to type in the date everytime. The text box is called EntryDate
So, to solve that problem I did one of these...
Private Sub Submit2_Click()
On Error GoTo Err_Submit2_Click
Dim savedate As Date
savedate = EntryDate
DoCmd.GoToRecord , , acNewRec
Me.EntryDate.SetFocus
Me.EntryDate = savedate
Exit_Submit2_Click:
Exit Sub
Err_Submit2_Click:
MsgBox Err.Description
Resume Exit_Submit2_Click
End Sub
I added the
Dim savedate As Date
savedate = EntryDate
Me.EntryDate = savedate
to the code so it would save the date.
This part of it works fine, however, now I have a new problem.
After submitting the last record, and hitting the 'X' to close, I get the
following error.
"The field 'Recrate Reason Table.Reason Code' cannot contain a Null Value
because the Required property for this field is set to True. Enter a value in
this field"
I still want Reason Code to be required for all the entries but I don't want
this message to pop up everytime.
So I tried to figure out some sort of delete record command on Form_close
but it was to no avail.
Please Help