Today's date from another control

  • Thread starter Thread starter Rohn Everson
  • Start date Start date
R

Rohn Everson

How can I capture todays DateTime when the user click the Status Closed
radio button on a form? I don't want the user to type the date. Only
collect the DateTime of when the status was changed?

I have a radio button = Status
I have a date control = StatusDate
Don't have Status controling StatusDate

any ideas?
Thanks, Rohn
 
If the option button is bound to a Yes/No field (instead of the usual check
box), in the option button's After Update event:

If Me.Status = True Then
Me.StatusDate = Now
End If

If there is an option group you will need to put the code into the group's
After Update event.

You may want to guard against somebody changing the status back to open.
That action won't change the StatusDate, but closing again will. That is,
if somebody goes to the record a month after it was closed, sets the status
to open, then sets it to closed, StatusDate will change.
 
Bruce,
No, it is bound to an SQL backend table with settings like: Char, 1, Nulls
ok, default (' '), indexed no.

That bring up a different problem with not being able to set "Y" and "N" in
the fields. I have "0" and "1" not yes/no. Have to fix this also, since I
want "Y" and "N."

Regards
 
On the first point, I'm not sure what to say since I am not very familiar
with SQL backend tables. Had you specified a SQL back end I would have left
the question to somebody else. However, I think you can still use the After
Update event as described, except from what I can tell you would be testing
for a numeric value rather than True.
You can display the information any way you want. For instance, in the
Control Source of an unbound text box:
=IIf([Status] = 1,"Y","N")
The same expression could be used in a query. You may need to test for
nulls, but that's the general idea.
 
Bruce, your suggestion worked GREAT..... Thanks!

So how would I NOT allow this date to be updated? I don't see any controls
for that!

Thanks again,
Rohn
 
Back
Top