If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Me.Filter using wildcard in formula
Hi,
I have a situation where I'm trying to filter on some records within a subform and I can't get it to work using a wildcard in the formula. I don't get an error message, it just doesn't function properly. We have five different Recognition Transaction Types that begin with "Unbilled" and I want to see all five transaction types when I choose "Unbilled" from a Value List. Here's the code: Private Sub Combo21_AfterUpdate() If IsNull(Me.Combo21) Then Me.FilterOn = False ElseIf Me.Combo21 = "Show All" Then Me.FilterOn = False Else Me.Filter = "RecognitionTransactionType = '" & Me.Combo21 & "*" & "'" Me.FilterOn = True End If End Sub Here are the five Recognition Transaction Types that begin with "Unbilled". Unbilled Hours - Overbudget Unbilled Hours - Pending Unbilled Hours - Percent Complete Unbilled Hours - Ratable Unbilled Hours - Unassigned Any help with how to work the wildcard into the formula would be much appreciated. |
#2
|
|||
|
|||
Me.Filter using wildcard in formula
On Tue, 24 Feb 2009 22:13:01 -0800, larochy wrote:
Hi, I have a situation where I'm trying to filter on some records within a subform and I can't get it to work using a wildcard in the formula. I don't get an error message, it just doesn't function properly. We have five different Recognition Transaction Types that begin with "Unbilled" and I want to see all five transaction types when I choose "Unbilled" from a Value List. Here's the code: Private Sub Combo21_AfterUpdate() If IsNull(Me.Combo21) Then Me.FilterOn = False ElseIf Me.Combo21 = "Show All" Then Me.FilterOn = False Else Me.Filter = "RecognitionTransactionType = '" & Me.Combo21 & "*" & "'" Me.FilterOn = True End If End Sub Here are the five Recognition Transaction Types that begin with "Unbilled". Unbilled Hours - Overbudget Unbilled Hours - Pending Unbilled Hours - Percent Complete Unbilled Hours - Ratable Unbilled Hours - Unassigned Any help with how to work the wildcard into the formula would be much appreciated. .. If you use wildcards you must use the Like keyword (not =) Me.Filter = "RecognitionTransactionType Like '" & Me.Combo21 & "*'" For clarity, the single and double quotes a Like ' " & Me.Combo21 & " * ' " -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#3
|
|||
|
|||
Me.Filter using wildcard in formula
Thank you!
"fredg" wrote: On Tue, 24 Feb 2009 22:13:01 -0800, larochy wrote: Hi, I have a situation where I'm trying to filter on some records within a subform and I can't get it to work using a wildcard in the formula. I don't get an error message, it just doesn't function properly. We have five different Recognition Transaction Types that begin with "Unbilled" and I want to see all five transaction types when I choose "Unbilled" from a Value List. Here's the code: Private Sub Combo21_AfterUpdate() If IsNull(Me.Combo21) Then Me.FilterOn = False ElseIf Me.Combo21 = "Show All" Then Me.FilterOn = False Else Me.Filter = "RecognitionTransactionType = '" & Me.Combo21 & "*" & "'" Me.FilterOn = True End If End Sub Here are the five Recognition Transaction Types that begin with "Unbilled". Unbilled Hours - Overbudget Unbilled Hours - Pending Unbilled Hours - Percent Complete Unbilled Hours - Ratable Unbilled Hours - Unassigned Any help with how to work the wildcard into the formula would be much appreciated. .. If you use wildcards you must use the Like keyword (not =) Me.Filter = "RecognitionTransactionType Like '" & Me.Combo21 & "*'" For clarity, the single and double quotes a Like ' " & Me.Combo21 & " * ' " -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
Thread Tools | |
Display Modes | |
|
|