Hello,
I am trying to use access vba instead of running an unmatched query.
I want to compare two tables and if there is a new sales office in
"Commission s" table that is not in the "Conversion " table I want to
know which region.
I'm lost. Can someone help? Here is my code.
Sub now()
Dim CurDb As Database
Dim rst As Recordset
Set CurDb = CurrentDb
Set rst = CurDb.OpenRecor dset("SELECT Commissions.[SALES OFFICE]"
& _
"FROM Commissions LEFT JOIN [Sales Office Conversion] ON
Commissions.[SALES OFFICE] = [Sales Office Conversion].Sales_Office" &
_
"GROUP BY Commissions.[SALES OFFICE], [Sales Office
Conversion].Sales_Office" & _
"HAVING ((([Sales Office Conversion].Sales_Office) Is
Null))" & _
"ORDER BY Commissions.[SALES OFFICE]")
With rst
MsgBox Commissions.[SALES OFFICE]
End With
rst.Close
Set rst = Nothing
End Sub
Sal
I am trying to use access vba instead of running an unmatched query.
I want to compare two tables and if there is a new sales office in
"Commission s" table that is not in the "Conversion " table I want to
know which region.
I'm lost. Can someone help? Here is my code.
Sub now()
Dim CurDb As Database
Dim rst As Recordset
Set CurDb = CurrentDb
Set rst = CurDb.OpenRecor dset("SELECT Commissions.[SALES OFFICE]"
& _
"FROM Commissions LEFT JOIN [Sales Office Conversion] ON
Commissions.[SALES OFFICE] = [Sales Office Conversion].Sales_Office" &
_
"GROUP BY Commissions.[SALES OFFICE], [Sales Office
Conversion].Sales_Office" & _
"HAVING ((([Sales Office Conversion].Sales_Office) Is
Null))" & _
"ORDER BY Commissions.[SALES OFFICE]")
With rst
MsgBox Commissions.[SALES OFFICE]
End With
rst.Close
Set rst = Nothing
End Sub
Sal
Comment