Date button to a Subform

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

I have a form which has as Datasheet sub form in it. On the datasheet
subform there is a colum that has a fied for a date. Is it posible to
have a click button on the main form that will but todays date inot the
data field on the subform.

I was not sure how to code this as i want to put it in a subform


Can help would be great

Simon
 
Simon,
Try using the DblClick of the subform YourDateField to update it to today's date.
Private Sub YourDateField_DblClick(Cancel As Integer)
YourDateField = Date
End Sub

No need to use up main form real estate with a button just for adding a date.

Minor point... you can always create a continuous subform that looks just like a
datasheet view. That way you have better control over your objects, colors, headers and
footers, labels, etc...
 
Is it on a new Record in the Subform like CreatedDate?

If that's the case, you can simply set the Default Property of the Field (in
the source Table) or the Control (on the Subform) 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