Hi Dave,
In your Type Of Maint combobox rowsource, you need to include the frequency
field. Let's call the combobox TypeOfMaint and say the frequency is in the third
column. Let's say the frequency is 30 days. Let's say the checkbox is called
Planned. Put the following code in the AfterUpdate event of the checkbox:
Dim Frequency As Integer
Frequency = Me!TypeOfMaint.Column(2)
If Me!Planned = True Then
Me!NextDueDate = DateAdd("D",Frequency, [DateWorkDone ])
Else
Me!NextDueDate = Null
End
Column(2) is used because columns are zero based making the third column 2
rather than 3.
If your frequency is measured in something other than days, lookup the DateAdd
function in the Help file for what to use in place of "D".
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com www.pcdatasheet.com
"Dave Mann" <bb*****@hotmail.com> wrote in message
news:67**************************@posting.google.c om...
Hi to all those Knowledge Brokers out there!
I am trying to get a field to return a date (Next Due date) only if a
box is checked (is it planned or unplanned)and Type of Work performed
(i.e if DNV add 12 months)
so for instance i fill in the fields like so:-
Date work done, Description of work, performed by, Type of
Maint(select from dropdown, this table has Frequency field), Planned
(check box)and work completed (Checkbox)
i want the Next Due Date Field to auto fill with a date base on If the
checkbox say yes it was planned and what type of maintenance was it
then return a date by adding the date done plus a value in the
frequency field of my maintenance types table.
hope this makes sence.
Rgds
Dave Mann