Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering

Status
Not open for further replies.

Dannybe2

Programmer
Joined
Jan 31, 2001
Messages
136
Location
GB
I am using the following code:

Private Sub SolveH_Click()

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Issues"

If Not IsNull(High) Then
stLinkCriteria = "[Priority]=" & "'" & Me![HighF] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If

End Sub

I want to change the filter so that as well as the priority being filtered, the status = 'Open' and I can't get it to do it. Do I use an 'And' command or a '&'?
 
You use AND:

Private Sub SolveH_Click()

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Issues"

If Not IsNull(High) Then
stLinkCriteria = "[Priority]=" & "'" & Me![HighF] & "' AND [Status] = 'Open'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If

End Sub

Good Luck

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top