Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2008

Tip: Looking for answers? Try searching our database.

Today's date from another control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rohn Everson - 20 Mar 2008 15:01 GMT
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
BruceM - 20 Mar 2008 15:24 GMT
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.

> 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
[quoted text clipped - 6 lines]
> any ideas?
> Thanks, Rohn
Rohn Everson - 20 Mar 2008 16:15 GMT
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

> 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:
[quoted text clipped - 21 lines]
>> any ideas?
>> Thanks, Rohn
BruceM - 20 Mar 2008 18:10 GMT
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,
> No, it is bound to an SQL backend table with settings like: Char, 1, Nulls
[quoted text clipped - 31 lines]
>>> any ideas?
>>> Thanks, Rohn
Rohn Everson - 26 Mar 2008 19:23 GMT
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

> 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:
[quoted text clipped - 21 lines]
>> any ideas?
>> Thanks, Rohn
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.