I have a list box full of audits. This information can be drilled down by location/area and whether the it is New
, Assigned (a), or Complete (c). The user pushes buttons on the form and text boxes are updated with a 1 or a 0. When it is 1 the button is pushed. So if n=1 a=1 and c=1 then the user want to see all the audits for that area. My problem is even though I have selected an area I am getting other areas to populate my list box. I am by no means an SQL guru so any help/suggestions would be wonderful! Here is just part of my code, I can post more if what I posted is not helping.
If intn = 1 And inta = 1 And intc = 1 Then
With Me.lbhistory
.RowSource = ""
strSQL = "SELECT * FROM tblhistory" & _
" WHERE([Status]='New' OR [Status]='Assigned' OR [Status]='Complete' AND [Area Audited]=""" & strarea & """ );"
.RowSource = ""
.RowSource = strSQL
.Requery
End With
I have all my endifs at the end of the code.
Thanks for any help you could provide.
If intn = 1 And inta = 1 And intc = 1 Then
With Me.lbhistory
.RowSource = ""
strSQL = "SELECT * FROM tblhistory" & _
" WHERE([Status]='New' OR [Status]='Assigned' OR [Status]='Complete' AND [Area Audited]=""" & strarea & """ );"
.RowSource = ""
.RowSource = strSQL
.Requery
End With
I have all my endifs at the end of the code.
Thanks for any help you could provide.