Hi...
Converting my Access FE app to Web browsing front end. I have the following code snippet of a function I run...
The line in red comes back with a type mismatch error and I cant think how to fix this in scripting... any help appreciated.
Also I cant seem to find out if DateAdd is a function that works in scripting.
Converting my Access FE app to Web browsing front end. I have the following code snippet of a function I run...
Code:
sub RecalcNextRun()
' Declare variables.
dim IntervalType
dim TimeShift
dim NextTimeToRun
dim WhatDay
dim WhatHour
' Set the IntervalType by getting the first character from IntMultiplyer
IntervalType = Left(document.Ack2.txtTaskMulti.value, 1)
'Set the TimeShift to ReTaskInterval
TimeShift = document.Ack2.txtTaskInterval.value
' If the IntervalType is w then we need to change this to d
' as w = weekday and d = day
if IntervalType = "w" then
IntervalType = "d"
Timeshift = Timeshift * 7
end if
' If the IntervalType is m then we need to change this to d
' and set the TimeShift to 28 time the TimeInterval
' This means that tasks will be completed every 4 weeks instead
' of calendar months and saves me lots of code trying to work
' out the first saturday of each month etc.
if IntervalType = "m" then
IntervalType = "d"
TimeShift = TimeShift * 28
end if
'Code to add the right amount of time so that the NextTimeToRun is updated correctly
[red]NextTimeToRun = FormatDateTime(document.Ack2.txtTaskNtR.value,vbGeneralDate)[/red]
NextTimeToRun = DateAdd(IntervalType, TimeShify, NextTimeToRun)
AdvanceDayByOne 'Call Function to advance day by one if required
The line in red comes back with a type mismatch error and I cant think how to fix this in scripting... any help appreciated.
Also I cant seem to find out if DateAdd is a function that works in scripting.