Dim cmd As ADODB.Command
Dim strQueryText As String
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandType = adCmdText
strQueryText = "SELECT Store_Profile.SPStoreNo, Store_Profile.SPSiteNo, Contact_Profile.CPExtAcctPhoneNo, Contact_Profile.CPExtAcctFaxNo"
strQueryText = strQueryText & "FROM Contact_Profile INNER JOIN Store_Profile ON Contact_Profile.SPStoreNo=Store_Profile.SPStoreNo" & ";"
cmd.CommandText = strQueryText
cmd.Execute
End Sub