I have 3 fields dateout, datein, TurnAroundNumber(number).
I used this code in module:
Expand|Select|Wrap|Line Numbers
- Function GetDateOut(dDate As Date, Span As Integer) As Date
- Dim j As Integer, i As Integer, dtStart
- dtStart = dDate
- For j = 1 To Span
- dtStart = dtStart + 1
- Do While Weekday(dtStart) = 1 Or Weekday(dtStart) = 7
- dtStart = dtStart + 1
- i = i + 1
- Loop
- Next
- GetDateOut = DateAdd("d", i + Span, dDate)
- End Function
me.[dateout]=getDateOut(me.dateIn, me.TurnAroundNumber)
I notice if the turnaroundnumber textbox is empty I get a null error.
Can I stop that from happening?
and can I place this in a subform and not adversely effect other objects and subforms.
Thank you