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  

Combo Box Filter



 
 
Thread Tools Display Modes
  #1  
Old May 12th, 2010, 01:51 PM posted to microsoft.public.access.forms
TR
external usenet poster
 
Posts: 28
Default Combo Box Filter

i have a form that is used for data entry. employees use the form to bring up
records. there are 2 combo boxes on the form to filter for specific records
in a Time Zone and particular Segment.

The underlying table as records - but 2 groups. Current and New.

I have a button on the form that can bring up the current group or the new
group. each are based on queries used as filters.
however, i only want employees to work on current group records.

the problem: when the employees are in the current group and use the combo
boxes for a specific time zone and segment the form shows both current and
new event though the current was filtered previously.

make sense? i don't know what i'm doing wrong. The event procedure for the
combo boxes is as follows and is on the AfterUpdate.
Option Compare Database

Private Sub Combo143_AfterUpdate()
Me.Filter = "[Segment Type] like '" & Me.Combo151 & "'" & " and [Time Zone]
like '" & Me.Combo143 & "'"

Me.FilterOn = True
End Sub

Private Sub Combo151_AfterUpdate()
Me.Filter = "[Segment Type] like '" & Me.Combo151 & "'" & " and [Time Zone]
like '" & Me.Combo143 & "'"

Me.FilterOn = True


  #2  
Old May 17th, 2010, 05:31 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Combo Box Filter

TR -

It sounds like you are changing filters with both a button (for New or
Current) and with combo boxes. You need to include the 'Current' criteria in
your filter, something like this (use your group field name):

Private Sub Combo143_AfterUpdate()
Me.Filter = "[Segment Type] like '" & Me.Combo151 & "'" & " and [Time Zone]
like '" & Me.Combo143 & "' AND [group] = 'Current'"

Me.FilterOn = True
End Sub

I used 'Current' because you said you want employees to only work on Current
group records. If you want to allow the same filtering for 'New' records,
then I would suggest changing the button to an option group where the user
selects either New or Current, and Current is the default option. Then you
can update your filter to select 'Current' or 'New' based on the radio button
selected (the value of the option group).

--
Daryl S


"TR" wrote:

i have a form that is used for data entry. employees use the form to bring up
records. there are 2 combo boxes on the form to filter for specific records
in a Time Zone and particular Segment.

The underlying table as records - but 2 groups. Current and New.

I have a button on the form that can bring up the current group or the new
group. each are based on queries used as filters.
however, i only want employees to work on current group records.

the problem: when the employees are in the current group and use the combo
boxes for a specific time zone and segment the form shows both current and
new event though the current was filtered previously.

make sense? i don't know what i'm doing wrong. The event procedure for the
combo boxes is as follows and is on the AfterUpdate.
Option Compare Database

Private Sub Combo143_AfterUpdate()
Me.Filter = "[Segment Type] like '" & Me.Combo151 & "'" & " and [Time Zone]
like '" & Me.Combo143 & "'"

Me.FilterOn = True
End Sub

Private Sub Combo151_AfterUpdate()
Me.Filter = "[Segment Type] like '" & Me.Combo151 & "'" & " and [Time Zone]
like '" & Me.Combo143 & "'"

Me.FilterOn = True


 




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 03:12 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.