Alhakeem1977
Registered User.
- Local time
- Today, 12:49
- Joined
- Jun 24, 2017
- Messages
- 308
Hi All,
I need to set my vba code to get the latest Date entered in one of two tables in a feild called (txtStartDate), but I do not know how to achieve it.
to clarify it more, if the last date entered in tblHolArchived [HolidayDate] field then take it else if it's in the other table Holiday [HolidayDate] take the value.
By the way the [DeletedDate] and [CreatedDate] are DateTime " Now() "
The earliest response would be highly appreciated.
Thanks a lot
I need to set my vba code to get the latest Date entered in one of two tables in a feild called (txtStartDate), but I do not know how to achieve it.
to clarify it more, if the last date entered in tblHolArchived [HolidayDate] field then take it else if it's in the other table Holiday [HolidayDate] take the value.
By the way the [DeletedDate] and [CreatedDate] are DateTime " Now() "
Code:
If DLookup("[HolidayDate]", "tblHolArchived", "[DeletedDate]= date()") Then
Me.txtStartDate = DLookup("[HolidayDate]", "tblHolArchived", "[DeletedDate]= Date()")
Me.txtDF = Me.txtStartDate
End If
If DLookup("HolidayDate", "Holiday", "[CreatedDate]= Date()") Then
Me.txtStartDate = DLookup("HolidayDate", "Holiday", "[CreatedDate]= Date()")
Me.txtDF = Me.txtStartDate
End If
The earliest response would be highly appreciated.
Thanks a lot