Having an unbound textbox change value based on another textbox value

jjake

Registered User.
Local time
Yesterday, 18:43
Joined
Oct 8, 2015
Messages
291
I have a form with 4 text boxes. [frmPM]

StartDate - CS Bound to query from tblPM
MaxOfCompletionDate - CS Bound to query from tblPMTaskCompletion
DueDate - CS =DateAdd("d",[txtCount],[StartDate])
txtCount

What i am trying to achieve,

If StartDate has a date entered into it the DueDate will be =DateAdd("d",[txtCount],[StartDate])

If StartDate and MaxOfCompletionDate have dates in them then Duedate will be =DateAdd("d",[txtCount],[MaxOfCompletionDate]) I think this is correct?

How would i make this work?

Thanks.
 
Make a function:
You will set duedate.source= SetDate()

Paste this code in the form somewhere...
Code:
Function SetDate()
   If isdate(txtStartDate) then
         If isnull(txtMax) then
               SetDate= dateadd(... Date)
         Else
              SetDate= dateadd(...max date)
         End if
   End if
End function
 
Make a function:
You will set duedate.source= SetDate()

Paste this code in the form somewhere...
Code:
Function SetDate()
   If isdate(txtStartDate) then
         If isnull(txtMax) then
               SetDate= dateadd(... Date)
         Else
              SetDate= dateadd(...max date)
         End if
   End if
End function

I got the following error.

359fwp0.jpg



I will upload some pictures to see if I did this right. I do not have much knowledge of functions.

2hd06d0.jpg


1o7z2f.jpg


9jhcib.jpg


175ukl.jpg


w0ruqu.jpg
 

Users who are viewing this thread

Back
Top Bottom