General discussion

Locked

Access date field

By Joemede ·
I have a table with 3 fields.
DateSubmitted
Status
DateClosed

DateSubmitted is set to date/time now()
Status has a drop down box to choose "Open" or "Closed"
How can I have the DateClosed field filled to current date/time based on choosing "Closed" from the status field?

I'm new to this so I'd appreciate any help,
Thanks, Joe

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by Bristar In reply to Access date field

If you are trying to do this from a table or query, it won't be possible. However, if you do it from a form, you can add a "Closed" button that could do a simple update with this simple code:

Me.DateClosed = Date
Me.Status = True

I use this on an IT Tracking database I wrote here in my office. If you have more questions, let me know!

Collapse -

by p.verhagen14 In reply to Access date field

If you are using a form with the 'MyStatus' combobox, you can add following code to the
'AfterUpdate' event:

Sub MyStatus_AfterUpdate
If MyStatus="Closed" then
DateClosed = Now()
End If
End Sub

This should be enough.

Peter

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums