I have the following strSQL (executed onClick) but it keeps prompting me for title, keyword1, keyword2, etc.
' Create SELECT statement.
strSQL = "SELECT Publications.InventoryLevel, Publications.InternetAvail, "
strSQL = strSQL & "Publications.Title, Publications.Keywords, "
strSQL = strSQL & "Publications.ResourceType, Publications.ContributorName, "
strSQL = strSQL & "Publications.ContributorPhone, Publications.ContributorUnit, "
strSQL = strSQL & "Publications.PublisherDistributor, Publications.PublisherRegion "
strSQL = strSQL & "FROM Publications INNER JOIN tblSubject ON Publications.Title = tblSubject.Title "
strSQL = strSQL & "WHERE (Publications.Title=[Forms]![frmSearch]![txtTitle]) OR "
strSQL = strSQL & "(tblSubject.Subject=[Forms]![frmSearch]![txtKeyword1]) OR "
strSQL = strSQL & "(tblSubject.Subject=[Forms]![frmSearch]![txtKeyword2]) OR "
strSQL = strSQL & "(tblSubject.Subject=[Forms]![frmSearch]![txtKeyword3]) OR "
strSQL = strSQL & "(tblSubject.Subject=[Forms]![frmSearch]![txtKeyword4]) OR "
strSQL = strSQL & "(tblSubject.Subject=[Forms]![frmSearch]![txtKeyword5]) OR "
strSQL = strSQL & "(tblSubject.Subject=[Forms]![frmSearch]![txtKeyword6]) "
What am I doing wrong?
Thanks,
Mickey
' Create SELECT statement.
strSQL = "SELECT Publications.InventoryLevel, Publications.InternetAvail, "
strSQL = strSQL & "Publications.Title, Publications.Keywords, "
strSQL = strSQL & "Publications.ResourceType, Publications.ContributorName, "
strSQL = strSQL & "Publications.ContributorPhone, Publications.ContributorUnit, "
strSQL = strSQL & "Publications.PublisherDistributor, Publications.PublisherRegion "
strSQL = strSQL & "FROM Publications INNER JOIN tblSubject ON Publications.Title = tblSubject.Title "
strSQL = strSQL & "WHERE (Publications.Title=[Forms]![frmSearch]![txtTitle]) OR "
strSQL = strSQL & "(tblSubject.Subject=[Forms]![frmSearch]![txtKeyword1]) OR "
strSQL = strSQL & "(tblSubject.Subject=[Forms]![frmSearch]![txtKeyword2]) OR "
strSQL = strSQL & "(tblSubject.Subject=[Forms]![frmSearch]![txtKeyword3]) OR "
strSQL = strSQL & "(tblSubject.Subject=[Forms]![frmSearch]![txtKeyword4]) OR "
strSQL = strSQL & "(tblSubject.Subject=[Forms]![frmSearch]![txtKeyword5]) OR "
strSQL = strSQL & "(tblSubject.Subject=[Forms]![frmSearch]![txtKeyword6]) "
What am I doing wrong?
Thanks,
Mickey