I am a vba newbie,
I currently have an access 2000 database.
A form displays about 3000 records, in an effort to provide a user with smaller views of the data, I have a option group tied to a macro that applys filters. The filters are queries.
In an effort to make it faster and simpler, I would like to write code to do the filtering and eliminate the queries. I have about 15 possible criteria in the option group, but I am having trouble writing the syntax correctly. The following if statement works, but I believe a Case would be more appropriate. Can someone covert this to a case, If I can see it for two conditions, I am sure I can add the others.
Thanks for the help. Ron
Private Sub Frame138_AfterUpdate()
If Frame138.Value = 1 Then
DoCmd.ApplyFilter , "CONT_STYPE = 'county planning'"
End If
If Frame138.Value = 2 Then
DoCmd.ApplyFilter , "CONT_STYPE = 'financial'"
End If
End Sub
I currently have an access 2000 database.
A form displays about 3000 records, in an effort to provide a user with smaller views of the data, I have a option group tied to a macro that applys filters. The filters are queries.
In an effort to make it faster and simpler, I would like to write code to do the filtering and eliminate the queries. I have about 15 possible criteria in the option group, but I am having trouble writing the syntax correctly. The following if statement works, but I believe a Case would be more appropriate. Can someone covert this to a case, If I can see it for two conditions, I am sure I can add the others.
Thanks for the help. Ron
Private Sub Frame138_AfterUpdate()
If Frame138.Value = 1 Then
DoCmd.ApplyFilter , "CONT_STYPE = 'county planning'"
End If
If Frame138.Value = 2 Then
DoCmd.ApplyFilter , "CONT_STYPE = 'financial'"
End If
End Sub