I have been fighting this for a couple of days and could use some help.
I have a program that keeps track of contacts made with people and need to know the last time (most recent date) that I contacted an individual and display the info. Here is what I have so far:
'Dim LLSQL As String
'Dim LLSearchString As String
'LLSearchString = txtSearchString 'txtSearchString and Contact are the same.
'LLSQL = "SELECT * FROM ContactsTBL WHERE Contact = '" & LLSearchString & "'"
'Form_LookUpPriorContactFRM.RecordSource = LLSQL
I then transfer this data from the LookUpPriorContactFRM form to the screen form for display. The problem is that I always get the oldest date and not the most recent. I've tried to add a second parameter to the SELECT statement but can't come up with the right combination to get it to work. I've tried DMAX(ContactDate,Table) and MAX(ContactDate) with no luck. Is it possible that RecordSource will not allow more than one parameter? If this ever works right it would only give me one record with the most recent date.
Can anyone help me with this problem?
Thanks
I have a program that keeps track of contacts made with people and need to know the last time (most recent date) that I contacted an individual and display the info. Here is what I have so far:
'Dim LLSQL As String
'Dim LLSearchString As String
'LLSearchString = txtSearchString 'txtSearchString and Contact are the same.
'LLSQL = "SELECT * FROM ContactsTBL WHERE Contact = '" & LLSearchString & "'"
'Form_LookUpPriorContactFRM.RecordSource = LLSQL
I then transfer this data from the LookUpPriorContactFRM form to the screen form for display. The problem is that I always get the oldest date and not the most recent. I've tried to add a second parameter to the SELECT statement but can't come up with the right combination to get it to work. I've tried DMAX(ContactDate,Table) and MAX(ContactDate) with no luck. Is it possible that RecordSource will not allow more than one parameter? If this ever works right it would only give me one record with the most recent date.
Can anyone help me with this problem?
Thanks