Hi all
I am trying to write some IF code on a form to do the following but doesn't seem to work, can someone give me some pointers please
Field Names
DateIn
DateOut
Avaliable (Yes/No)
Basically what I need is when DateIn has a date and DateOut is blank then Avaliable field is FALSE, when both DateIn and DateOut have dates then the Avaliable field is TRUE
I am very new to the coding scene so please don't laugh if its completely wrong ;/
I am trying to write some IF code on a form to do the following but doesn't seem to work, can someone give me some pointers please
Field Names
DateIn
DateOut
Avaliable (Yes/No)
Basically what I need is when DateIn has a date and DateOut is blank then Avaliable field is FALSE, when both DateIn and DateOut have dates then the Avaliable field is TRUE
I am very new to the coding scene so please don't laugh if its completely wrong ;/
Code:
Private Sub DateIn_AfterUpdate()
If Me.DateIn > Null And Me.DateOut = Null Then
Me.VehicleAvaliable = False
End If
If Me.DateIn > Null And Me.DateOut > Null Then
Me.VehicleAvaliable = True
End If
End Sub