Some people helped me get my "if" statement working for this code here:
If Me.No_takeoff = -1 Then
TxtLaunch.Value = "No Takeoff"
Me.TxtLand = TimeValue(Now)
TxtLand.SetFocus
Else
If Me.No_takeoff = 0 Then
Me.TxtLand = TimeValue(Now)
TxtLand.SetFocus
TxtTotal.Value = (TxtLand.Value - TxtLaunch.Value)
End If
End If
However, now the "TxtTotal.Value = (TxtLand.Value - TxtLaunch.Value)" doesn't work as I had to change the data type for that field in the table from date/time to text as I wanted to add the "No takeoff" function. It now comes up with "Type Mismatch" even though all 3 columns are set to text and have the same properties.. It used to work fine when I had the data type as Date/Time and not the If statement ^^
What did I do
If Me.No_takeoff = -1 Then
TxtLaunch.Value = "No Takeoff"
Me.TxtLand = TimeValue(Now)
TxtLand.SetFocus
Else
If Me.No_takeoff = 0 Then
Me.TxtLand = TimeValue(Now)
TxtLand.SetFocus
TxtTotal.Value = (TxtLand.Value - TxtLaunch.Value)
End If
End If
However, now the "TxtTotal.Value = (TxtLand.Value - TxtLaunch.Value)" doesn't work as I had to change the data type for that field in the table from date/time to text as I wanted to add the "No takeoff" function. It now comes up with "Type Mismatch" even though all 3 columns are set to text and have the same properties.. It used to work fine when I had the data type as Date/Time and not the If statement ^^
What did I do
