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 / May 2008

Tip: Looking for answers? Try searching our database.

change field value on form based on another

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
norm - 15 May 2008 21:35 GMT
I have a form that displays New Vehicle Inventorty in stock, it is called
STATUS, and it will diplay "N" for NEW what I would like to do is, when the
STATUS Field changes N to A (for ACTIVE), I would like to fill in a field in
my form with TODAY'S DATE. The vehicle would stay "A"ctive for years, but on
the end of it's lifecycle it will change to "R"elinquished, but I need to
preserve the in-service date, so I only need the field to change when STATUS
is changed to A. I hope I explained this correctly.
Thank you all for your time.
Jeff Boyce - 15 May 2008 23:14 GMT
Norm

So you'd need to have Access check each time that control is updated to see
if the update was "A".  If it was, Access would need to add today's date
into another control.  That should be fairly straightforward... but!

If someone sets a record to "A" last week, then someone else sets it back to
"N" on Monday, and you set it back to "A" again yesterday, do you really
want yesterday's date in the other field?  You might need to figure out how
you'll handle "corrections".

You can add an Event Procedure to the control's AfterUpdate event, looking
something like:

   If Me!Status = "A" Then
       Me!InServiceDate = Date()
   Else
       Me!InServiceDate = Null
   End If

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

>I have a form that displays New Vehicle Inventorty in stock, it is called
>STATUS, and it will diplay "N" for NEW what I would like to do is, when the
[quoted text clipped - 4 lines]
>when STATUS is changed to A. I hope I explained this correctly.
> Thank you all for your time.
norm - 15 May 2008 23:56 GMT
Thank you very much Jeff!
that works perfectly!
but I need to save the inservice date. in other words when "N" turns to "A"
give me the inservicdate, now when the vehicle has finished it's lifecycle
it will become "R" for relinquished, "D" for Destroyed and few other codes
we use, but I do not want to change the inservecedate, only when STATUS
turns to "A" give me the date ignoring the rest.

Thank you so much for your time!
Jeff Boyce - 16 May 2008 16:04 GMT
Norm

I must have misunderstood.  I thought you actually already had a field in
your table to hold [InserviceDate].  If you don't, add one.

Regards

Jeff Boyce
Microsoft Office/Access MVP

> Thank you very much Jeff!
> that works perfectly!
[quoted text clipped - 5 lines]
>
> Thank you so much for your time!
norm - 17 May 2008 15:26 GMT
I do have the filed InService date abd all works fine, but I did not explain
myself, when it chages to "A" it adds the date - PERFECT! now when the
vehicle is "R"elinquished, I still need to leave the InService Date as it
was when it was "A"ctive. So when the vehicle goes from "N"ew to "A"ctive,
change the inservice date, now the vehicle is being junked or transferred we
I change the status to "R"elinquished "C"ondemmended, etc.. but I need to
preserve the InService date as "A"ctive, or the vehicle's birthday sort of
speak.
Thanks for your time
Jason - 18 May 2008 04:03 GMT
Remove:
   Else
       Me!InServiceDate = Null
> I do have the filed InService date abd all works fine, but I did not explain
> myself, when it chages to "A" it adds the date - PERFECT! now when the
[quoted text clipped - 5 lines]
> speak.
> Thanks for your time
 
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.