Working on a form where I need to calculate a date in one text box based on data in two others. There are three textboxes involved. I have tried searching, but for some reason, the search function does not seem to work if I add a second word to the search.
txtType (text)
txtEventDate (date/time)
txtEstDateSend (date/time)
if txtType = A
take the date value in txtEventDate and subtract 21 days, placing this value in txtEventDate
if txtType = B
take the date value in txtEventDate and subtract 42 days, placing this value in txtEventDate
if txtType=anything else
put nothing in txtEvent Date
I have tried the following VB in the afterupdate attribute of txtEventDate, but nothing happens:
Private Sub txtEventDate_AfterUpdate()
If Me!cmbEvent.Value = "Seminar" Then
Me!txtEstimateDateSend.Value = DateAdd("d", -21, Me!txtEventDate.Value)
Else: Me!txtEstimateDateSend.Value = ""
End If
End Sub
txtType (text)
txtEventDate (date/time)
txtEstDateSend (date/time)
if txtType = A
take the date value in txtEventDate and subtract 21 days, placing this value in txtEventDate
if txtType = B
take the date value in txtEventDate and subtract 42 days, placing this value in txtEventDate
if txtType=anything else
put nothing in txtEvent Date
I have tried the following VB in the afterupdate attribute of txtEventDate, but nothing happens:
Private Sub txtEventDate_AfterUpdate()
If Me!cmbEvent.Value = "Seminar" Then
Me!txtEstimateDateSend.Value = DateAdd("d", -21, Me!txtEventDate.Value)
Else: Me!txtEstimateDateSend.Value = ""
End If
End Sub