required field in a form.

  • Thread starter Thread starter spcscooter via AccessMonster.com
  • Start date Start date
S

spcscooter via AccessMonster.com

I have a form that consists of a field that if it is double clicked it will
enter Now(). I need to make sure that the user doesn't miss this field and
cannot go to the next record until the field has Now(). I have tried the
following... Before Update, After Update and the validation rule. I don't
get any errors but I can still go to the next record. Please Help!!! I am
sure that this is really easy and I probably did something real stupid. Can
you give me an example of the best way to do it.

The field that I need to require is Post_Called_Customer
The Form Name is Main Info
And the double click will return Now().

Thank you very much!!!!
 
Hi,

Not sure which event is for you,but it seems that you miss one or two lines
like,
If IsNull(Me.Post_Called_Customer) Then
MsgBox "Double Click on Post_Called_Customer Please"
DoCmd.GoToRecord , , acLast
Me.Post_Called_Customer.SetFocus
End If
 
I think you are wanting to assign the value of Now() at the time the user
first saves the record?

If so, use the BeforeUpdate event of the form to assign the value:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.NewRecord Then
Me.[Post_Called_Customer] = Now()
End If
End Sub

Note that Now() includes the time as well as the date. If you just wanted
the date, you could get away without any code. Just set the Default Value
property of the text box to:
=Date()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top