it is better to check all records .but if it could find the first one should pop a message..I really just need the notice to pop out .Hi. Tables could have more than one record. How do you determine which records to compare?
Maybe you can give us some sample data to help us understand what you need. If there are multiple dates in both tables, you will inevitably get the popup.it is better to check all records .but if it could find the first one should pop a message..I really just need the notice to pop out .
Ah, so you're not trying to compare two tables then. Instead, you just want to compare two columns in one table, and all the records have the same dates, correct? If so, you should be able to use DLookup().One table with two date fields .if return to service date < event occurrence , then pop a messagView attachment 95092e
yes two fields in one table ....Ah, so you're not trying to compare two tables then. Instead, you just want to compare two columns in one table, and all the records have the same dates, correct? If so, you should be able to use DLookup().
So, did you try using DLookup()? For example:yes two fields in one table ....
If DLookup("[Return to Service Date]<[Event Occurrence]", "TableName")=True Then
Msgbox "Popup message here."
End If
Yes i tested .It doesn't work .i have no error on it but no message pops...So, did you try using DLookup()? For example:
Code:If DLookup("[Return to Service Date]<[Event Occurrence]", "TableName")=True Then Msgbox "Popup message here." End If
Are those date columns actually Date/Time data types? Or, are they Short Text?Yes i tested .It doesn't work .i have no error on it but no message pops...
Are you wanting to get that message box at the time data is entered in for a record? If so, then that code would go into a Before Update event. That's usually how I would set something like that up. This prevents bad data from going into the table in the first place.I have a table and want to compare dates .if date 1> date 2 , then pop a message .
Yes ,update events ? what do mean .?Are you wanting to get that message box at the time data is entered in for a record? If so, then that code would go into a Before Update event. That's usually how I would set something like that up. This prevents bad data from going into the table in the first place.
yes both are Date/Time data types.Are those date columns actually Date/Time data types? Or, are they Short Text?
In that case, try the following code and let us know if the result makes sense.yes both are Date/Time data types.
If DLookup("[Return to Service Date]<[Event Occurrence]", "TableName")=True Then
MsgBox "Popup message here."
Else
MsgBox DLookup("[Return to Service Date]", "TableName") _
& " is not lesser/earlier than " & DLookup("[Event Occurrence]", "TableName")
End If
Thank you very much.it worked properly .In that case, try the following code and let us know if the result makes sense.
Code:If DLookup("[Return to Service Date]<[Event Occurrence]", "TableName")=True Then MsgBox "Popup message here." Else MsgBox DLookup("[Return to Service Date]", "TableName") _ & " is not lesser/earlier than " & DLookup("[Event Occurrence]", "TableName") End If
Okay. Glad to hear you got it sorted out. Good luck with your project.Thank you very much.it worked properly .![]()