L
Liz Hansen
Hi,
I need help figuring out a filter. I have a form based on a table. I
already have one functional filter and I thought I could use the same code
and just change the details... Below is the original code that works for a
field called "Active" that has either "-1" or "0" as a value. The field I
need to filter is called "policynum" and has many different values, all
numbers. I need to find all records with the value "11". So I tried
changing the code "-1" to "11" but that didn't work. Any suggestions?
Thanks in advance,
Liz
Dim strNewRecord As String
Select Case frmSelectGroup
Case 1
strNewRecord = "SELECT * FROM tblEmp " _
& " WHERE Active = - 1"
Forms!frmChooseEmployee.sfrmChooseEmployee.Form.RecordSource =
strNewRecord
Forms!frmChooseEmployee.sfrmChooseEmployee.Form.Requery
Case 2
strNewRecord = "SELECT * FROM tblEmp " _
& " WHERE Active = 0"
Forms!frmChooseEmployee.sfrmChooseEmployee.Form.RecordSource =
strNewRecord
Forms!frmChooseEmployee.sfrmChooseEmployee.Form.Requery
Case 3
Forms!frmChooseEmployee.sfrmChooseEmployee.Form.RecordSource = "tblEmp"
Forms!frmChooseEmployee.sfrmChooseEmployee.Form.Requery
End Select
I need help figuring out a filter. I have a form based on a table. I
already have one functional filter and I thought I could use the same code
and just change the details... Below is the original code that works for a
field called "Active" that has either "-1" or "0" as a value. The field I
need to filter is called "policynum" and has many different values, all
numbers. I need to find all records with the value "11". So I tried
changing the code "-1" to "11" but that didn't work. Any suggestions?
Thanks in advance,
Liz
Dim strNewRecord As String
Select Case frmSelectGroup
Case 1
strNewRecord = "SELECT * FROM tblEmp " _
& " WHERE Active = - 1"
Forms!frmChooseEmployee.sfrmChooseEmployee.Form.RecordSource =
strNewRecord
Forms!frmChooseEmployee.sfrmChooseEmployee.Form.Requery
Case 2
strNewRecord = "SELECT * FROM tblEmp " _
& " WHERE Active = 0"
Forms!frmChooseEmployee.sfrmChooseEmployee.Form.RecordSource =
strNewRecord
Forms!frmChooseEmployee.sfrmChooseEmployee.Form.Requery
Case 3
Forms!frmChooseEmployee.sfrmChooseEmployee.Form.RecordSource = "tblEmp"
Forms!frmChooseEmployee.sfrmChooseEmployee.Form.Requery
End Select