potts
Registered User.
- Local time
- Today, 00:02
- Joined
- Jul 24, 2002
- Messages
- 87
I have the following code:
If Not IsNothing (Me!Keycodes) Then
gstrArticle = "[ArticleID] IN " & " (SELECT ArticleID FROM " & " _
qryArticleKeyword" & " Keyword IN (" & Me!KeyCodes & ")"
Else
gstrArticle = gstrArticle & " AND [ArticleID] IN " & " (SELECT _ ArticleID FROM " & " qryArticleKeyword" & " Keyword IN _
(" & Me!KeyCodes & ")"
End If
The code is attached to the On Click event of a command button on an unbound search form.
KeyCodes is an unbound text box that holds the Keyword
qryArticleKeyword is based on the link table in a many - many relationship, which has fields ArticleID and Keyword as its primary key.
DoCmd.OpenForm "frmArticles", Wherecondition:= gstrArticle
I have used the same code (minus the SELECT SQL) for the other unbound controls on the search form with no problems. However, this time I keep getting a message box requesting the entry of the parameter value and the Keyword(s) selected (there is one message box for each keyword).
It is possibly of note that this is the only control so far to contain multiple selections.
Can anyone see where I might be going wrong?
If Not IsNothing (Me!Keycodes) Then
gstrArticle = "[ArticleID] IN " & " (SELECT ArticleID FROM " & " _
qryArticleKeyword" & " Keyword IN (" & Me!KeyCodes & ")"
Else
gstrArticle = gstrArticle & " AND [ArticleID] IN " & " (SELECT _ ArticleID FROM " & " qryArticleKeyword" & " Keyword IN _
(" & Me!KeyCodes & ")"
End If
The code is attached to the On Click event of a command button on an unbound search form.
KeyCodes is an unbound text box that holds the Keyword
qryArticleKeyword is based on the link table in a many - many relationship, which has fields ArticleID and Keyword as its primary key.
DoCmd.OpenForm "frmArticles", Wherecondition:= gstrArticle
I have used the same code (minus the SELECT SQL) for the other unbound controls on the search form with no problems. However, this time I keep getting a message box requesting the entry of the parameter value and the Keyword(s) selected (there is one message box for each keyword).
It is possibly of note that this is the only control so far to contain multiple selections.
Can anyone see where I might be going wrong?