Hello I have managed to confuse myself more than normal.
I have an Accounts Form which populates on open from a DOA recordet that I create from an external table.
I have all of that working fine. At the moment I am soing a SELECT * and this works fine.
What I actually want to do is exclude certain records.
For example there is a TYPE field in the table and I want to select everything except records with a TYPE of "Deposit Paid"
My current working code is:
I have tried all sort of efforts such as:
I could do with some help. Many thanks Mark
I have an Accounts Form which populates on open from a DOA recordet that I create from an external table.
I have all of that working fine. At the moment I am soing a SELECT * and this works fine.
What I actually want to do is exclude certain records.
For example there is a TYPE field in the table and I want to select everything except records with a TYPE of "Deposit Paid"
My current working code is:
Code:
Dim strSQL As String
Dim rs As DAO.Recordset
strSQL = "SELECT * FROM " & Me.txt_Gem_Account_No.Value
strSQL = strSQL & " ORDER BY date desc"
Set rs = db.OpenRecordset(strSQL)
I have tried all sort of efforts such as:
Code:
Dim strSQL As String
Dim rs As DAO.Recordset
strSQL = "SELECT * FROM " & Me.txt_Gem_Account_No.Value &, _
"WHERE [type] <> 'rent paid"
strSQL = strSQL & " ORDER BY date desc"
Set rs = db.OpenRecordset(strSQL)
I could do with some help. Many thanks Mark