Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One field that updates another field..

Status
Not open for further replies.

Computethis

IS-IT--Management
Feb 5, 2001
28
US
I have a form built off a query that is built from a Table.

frmOrderLog
qryOrderLog
tblOrderLog

I have two fields: One is the current delivery date "DelDate", the other is the Delivery Date Time Stamp.. "DelDateTS"

I would like that each time you "change or modify" the DelDate field that a new date/time be recorded in the DelDateTS field. Set Value on a macro does not seem to work.

Can anyone help?

Thanks,
Mitch

 
Mitch:

I don't work with macros, but if you want to tinker with a little VB code do this. (I assume you want to set the DelDateTS to a date +/- DelDate?)

In the DelDate's event properties select AfterUpdate, click on the elipses button (three dots to the right of the property sheet) and select code builder.

Between the lines Private Sub and End Sub type this:

DelDateTS = DateAdd("d", 7, DelDate)

I don't mean to be offensive with this much specificity but, since I don't know your level of experience, it's better to err on the side of over-explaining.

This will set the value of DelDateTS to one week (7 Days) after the DelDate. Check out DateAdd in Access help for additional information on the interval (the "d" part).

Hope this helps.
Larry De Laruelle
larry1de@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top