A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Me.Filter using wildcard in formula



 
 
Thread Tools Display Modes
  #1  
Old February 25th, 2009, 06:13 AM posted to microsoft.public.access.forms
larochy
external usenet poster
 
Posts: 26
Default 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  
Old February 25th, 2009, 06:34 AM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default 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  
Old February 25th, 2009, 01:20 PM posted to microsoft.public.access.forms
larochy
external usenet poster
 
Posts: 26
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:56 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.