Hi,
I have a form that is tied to a query. on the form I have two dropdown boxes - one lists all the possible "names" and the other lists all the possible "ranks" I want the user to be able to select a value in each dropdown to search on, then click a button which will find records matching "name & Rank" in the query - displaying the query (where user-selected name And user-selected Rank = these results)
This is what I've tried to piece together, but I get a "misuse of null" error. Maybe I'm close??
thanks!
Private Sub Command9_Click()
Dim stDocName As String
Dim stOne As String
Dim stTwo As String
Dim strsql As String
stDocName = "Query1"
stOne = CmboName.Value
stTwo = CmboRank.Value
strsql = "select Name from Query1" & "where stOne = " & Name & "Select Rank from Query1" & "where stName = " & Rank
DoCmd.FindRecord "Query1", acViewNormal, , strsql
I have a form that is tied to a query. on the form I have two dropdown boxes - one lists all the possible "names" and the other lists all the possible "ranks" I want the user to be able to select a value in each dropdown to search on, then click a button which will find records matching "name & Rank" in the query - displaying the query (where user-selected name And user-selected Rank = these results)
This is what I've tried to piece together, but I get a "misuse of null" error. Maybe I'm close??
thanks!
Private Sub Command9_Click()
Dim stDocName As String
Dim stOne As String
Dim stTwo As String
Dim strsql As String
stDocName = "Query1"
stOne = CmboName.Value
stTwo = CmboRank.Value
strsql = "select Name from Query1" & "where stOne = " & Name & "Select Rank from Query1" & "where stName = " & Rank
DoCmd.FindRecord "Query1", acViewNormal, , strsql