Filtering record using combo box list

I've created a form with a combox box and a button to search for records in a 
table. The button is linked to a macro which filters the table, opens and 
shows the desired record(s) in another form.

The 'where' condition in the macro specifies the criteria for filtering, ie. 
the value selected in the combo box should be equal to a table field. The 
desired records did come out but the strange thing is that, an extra record 
will also appear. To my horror, the field which is being used as a criteria 
has been altered. So I tested out with other values in the combo box and each 
time this happened again. I'm playing hide-and-seek with the software and 
changing the values back to their original.

I've being trying to tackle this problem but to no avail. Does anyone ever 
encounter this problem before or know what's causing it ? I cannot afford to 
have untrue data in my table again.
0
Utf
12/10/2007 9:50:02 AM
access.forms 6864 articles. 1 followers. Follow

4 Replies
877 Views

Similar Articles

[PageSpeed] 30

The combo you are using to filter the form - is it bound to a field?
Or does it show "Unbound" when you open the form in design view?

You need to use an *unbound* combo to filter the form. Don't try to use the 
one combo for both data entry and for filtering.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"lhtan123" <lhtan123@discussions.microsoft.com> wrote in message
news:2B3B5B1E-8494-4930-A04E-887FDE410EA0@microsoft.com...
> I've created a form with a combox box and a button to search for records 
> in a
> table. The button is linked to a macro which filters the table, opens and
> shows the desired record(s) in another form.
>
> The 'where' condition in the macro specifies the criteria for filtering, 
> ie.
> the value selected in the combo box should be equal to a table field. The
> desired records did come out but the strange thing is that, an extra 
> record
> will also appear. To my horror, the field which is being used as a 
> criteria
> has been altered. So I tested out with other values in the combo box and 
> each
> time this happened again. I'm playing hide-and-seek with the software and
> changing the values back to their original.
>
> I've being trying to tackle this problem but to no avail. Does anyone ever
> encounter this problem before or know what's causing it ? I cannot afford 
> to
> have untrue data in my table again. 

0
Allen
12/10/2007 11:42:06 AM
So are you suggesting that I create the combo box list using another table 
instead of binding the combox box to a field in the table which is the 
recordset for the form ?

In that way, I'll have to update the combo box list seperately from the 
table everytime when there's a new value. There's no other convenient way ?

"Allen Browne" wrote:

> The combo you are using to filter the form - is it bound to a field?
> Or does it show "Unbound" when you open the form in design view?
> 
> You need to use an *unbound* combo to filter the form. Don't try to use the 
> one combo for both data entry and for filtering.
> 
> -- 
> Allen Browne - Microsoft MVP.  Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
> 
> "lhtan123" <lhtan123@discussions.microsoft.com> wrote in message
> news:2B3B5B1E-8494-4930-A04E-887FDE410EA0@microsoft.com...
> > I've created a form with a combox box and a button to search for records 
> > in a
> > table. The button is linked to a macro which filters the table, opens and
> > shows the desired record(s) in another form.
> >
> > The 'where' condition in the macro specifies the criteria for filtering, 
> > ie.
> > the value selected in the combo box should be equal to a table field. The
> > desired records did come out but the strange thing is that, an extra 
> > record
> > will also appear. To my horror, the field which is being used as a 
> > criteria
> > has been altered. So I tested out with other values in the combo box and 
> > each
> > time this happened again. I'm playing hide-and-seek with the software and
> > changing the values back to their original.
> >
> > I've being trying to tackle this problem but to no avail. Does anyone ever
> > encounter this problem before or know what's causing it ? I cannot afford 
> > to
> > have untrue data in my table again. 
> 
> 
0
Utf
12/11/2007 1:21:01 AM
Thank you. It works now. But I'm curious about why that occurs. 

"lhtan123" wrote:

> So are you suggesting that I create the combo box list using another table 
> instead of binding the combox box to a field in the table which is the 
> recordset for the form ?
> 
> In that way, I'll have to update the combo box list seperately from the 
> table everytime when there's a new value. There's no other convenient way ?
> 
> "Allen Browne" wrote:
> 
> > The combo you are using to filter the form - is it bound to a field?
> > Or does it show "Unbound" when you open the form in design view?
> > 
> > You need to use an *unbound* combo to filter the form. Don't try to use the 
> > one combo for both data entry and for filtering.
> > 
> > -- 
> > Allen Browne - Microsoft MVP.  Perth, Western Australia
> > Tips for Access users - http://allenbrowne.com/tips.html
> > Reply to group, rather than allenbrowne at mvps dot org.
> > 
> > "lhtan123" <lhtan123@discussions.microsoft.com> wrote in message
> > news:2B3B5B1E-8494-4930-A04E-887FDE410EA0@microsoft.com...
> > > I've created a form with a combox box and a button to search for records 
> > > in a
> > > table. The button is linked to a macro which filters the table, opens and
> > > shows the desired record(s) in another form.
> > >
> > > The 'where' condition in the macro specifies the criteria for filtering, 
> > > ie.
> > > the value selected in the combo box should be equal to a table field. The
> > > desired records did come out but the strange thing is that, an extra 
> > > record
> > > will also appear. To my horror, the field which is being used as a 
> > > criteria
> > > has been altered. So I tested out with other values in the combo box and 
> > > each
> > > time this happened again. I'm playing hide-and-seek with the software and
> > > changing the values back to their original.
> > >
> > > I've being trying to tackle this problem but to no avail. Does anyone ever
> > > encounter this problem before or know what's causing it ? I cannot afford 
> > > to
> > > have untrue data in my table again. 
> > 
> > 
0
Utf
12/11/2007 2:56:00 AM
You have it working, so that's good.

The idea was not to bind the combo to a different table, but to leave it 
unbound.

If the combo is bound to a field, it makes sense that the combo will change 
the value of the field *before* you move away from that record and apply a 
filter or jump to another.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"lhtan123" <lhtan123@discussions.microsoft.com> wrote in message
news:A801FEF6-4B38-4FDF-944C-8C597E49476C@microsoft.com...
> Thank you. It works now. But I'm curious about why that occurs.
>
> "lhtan123" wrote:
>
>> So are you suggesting that I create the combo box list using another 
>> table
>> instead of binding the combox box to a field in the table which is the
>> recordset for the form ?
>>
>> In that way, I'll have to update the combo box list seperately from the
>> table everytime when there's a new value. There's no other convenient way 
>> ?
>>
>> "Allen Browne" wrote:
>>
>> > The combo you are using to filter the form - is it bound to a field?
>> > Or does it show "Unbound" when you open the form in design view?
>> >
>> > You need to use an *unbound* combo to filter the form. Don't try to use 
>> > the
>> > one combo for both data entry and for filtering.
>> >
>> > "lhtan123" <lhtan123@discussions.microsoft.com> wrote in message
>> > news:2B3B5B1E-8494-4930-A04E-887FDE410EA0@microsoft.com...
>> > > I've created a form with a combox box and a button to search for 
>> > > records
>> > > in a
>> > > table. The button is linked to a macro which filters the table, opens 
>> > > and
>> > > shows the desired record(s) in another form.
>> > >
>> > > The 'where' condition in the macro specifies the criteria for 
>> > > filtering,
>> > > ie.
>> > > the value selected in the combo box should be equal to a table field. 
>> > > The
>> > > desired records did come out but the strange thing is that, an extra
>> > > record
>> > > will also appear. To my horror, the field which is being used as a
>> > > criteria
>> > > has been altered. So I tested out with other values in the combo box 
>> > > and
>> > > each
>> > > time this happened again. I'm playing hide-and-seek with the software 
>> > > and
>> > > changing the values back to their original.
>> > >
>> > > I've being trying to tackle this problem but to no avail. Does anyone 
>> > > ever
>> > > encounter this problem before or know what's causing it ? I cannot 
>> > > afford
>> > > to
>> > > have untrue data in my table again. 

0
Allen
12/11/2007 10:18:46 AM
Reply:

Similar Artilces:

Filters *SOS* Filters *SOS* Filters *SOS*
1) On formLoad, I need to show only those items which are unassigned. 2) I need for the end-under to select only the items they are assigned to. 3) I need an option to select "ALL" so I can view all items. Any insight offered would be appreciated!!! On Wed, 29 Aug 2007 16:24:01 -0700, valdaiway <valdaiway@discussions.microsoft.com> wrote: >1) On formLoad, I need to show only those items which are unassigned. Use a query to put a criterion on the field that defines the assigned status. I assume you know how that information is stored in your table; nobody here does, ...

Criteria for Advanced Filter HELP
I have what I think is a simple question that I need answered IMMEDIATELY. I have a spreadsheet with 20 fields and I want to filter it so it only shows records that have something in of any of 5 of those fields. So once filtered, I will not have any records that have all 5 of those fields blank. I know I have done this before but I'll be damned if I can remember or find out how. -- Thanks You all are teaching me so much don't cross-post -- answer supplied in misc NG "knowshowrosegrows" <knowshowrosegrows@discussions.microsoft.com> wrote in message news:ACBC0...

Employee Filters
Hello: On the employee filters in the HR Preferenes window, would this restrict seeing employee information in both Payroll and HR? Also, would it restrict reporting on certain employees in a division or department? Thanks! childofthe1980s Your message does not indicate which version of Great Plains you are using. Using 8.0 with SP3 applied, HR filters do apply to some of employee information outside of HR. The settings will filter selected forms, Smartlists and Lists items. The HR filter setting do not apply to reports outside of HR. The filtered forms are: Employee Maintenance,...

Useful XML .net classes
These are two small classes I created that I use a lot. Between them you can access an XML file almost anywhere. XmlZipResolver An XmlUrlResolver for files in a zip file In the java world a file you can pass a filename of "zip:MyStuff.zip!MyData.xml" and it then handles the MyData.xml file as the xml file to read. The attached file here does the same thing on the .NET side by providing a XmlUrlResolver derived class to handle this case. This code was about 95% the code from news.oreilly.com/XmlZipResolver.cs where I cleaned it up a little and fixed a couple of subtle bugs. Just ...

Show Alll records Types relating to PersonID
I'm Trying to create a charge report from a tbl called tblcharges which has the following ClaimID PersonID DOSFrom DOsTo Procedure Fee BillTo which is a combo box and has a macro event which is a requery and the following sql code In this combo box patient could have 2 insurances example Medicare which is Primary And Medical which Is Secondary and this will be stored in the tblPeopleInsurance.Type Field which are P = Primary and S= Secondary. Lets Say I will select Medicare because this is the patient primary insurance. SELECT tblPeopleInsurance.GuaranterID, tblPeopleInsurance.PersonID, ...

hide dialog box application
I want to hide dialog box application. Overriding OnWindowShow of the main dialog class, and inside calling ShowWindow for hiding, does nothing. Doing so inside OnPaint works, but causes annoying flicker. Can someone advise please? Regards Marom See my essay on dialog box applications on my MVP Tips site (Nish gave me permission to reproduce his technique in my essay, and I link to his site as well) joe On Tue, 26 Dec 2006 22:57:44 +0200, "Marom" <kmarom@miran.net> wrote: >I want to hide dialog box application. Overriding OnWindowShow of the main >dialog ...

Using Excel For Statistics
Hi ! I wanted to know if someone would know if there is a downloadable version of Excel add-ons of Data-Analysis and Data Analysis Plus for Macintosh? lance.fletcher - The "Data Analysis" add-in, usually called "Analysis ToolPak," is provided on the Office/Excel installation disks. It is not available for download. The "Data Analysis Plus" add-in may refer to the add-in on the CD that accompanies statistics textbooks by Gerald Keller (and perhaps textbooks by some other authors). I doubt that it is available for download. Maybe you could contact the auth...

Filtering based on a filter
Hello, I have an Excel Worksheet with a Pivot Table at the top with a Filter and a data set returned from a DB2 database below it. I would like to filter the DB2 data set based on the Pivot Table filter that is enabled. Any ideas? Thanks! James, You can't filter two ranges on the same worksheet. You can, instead, drill-down on your pivot table, which will show all items that go into the value on a newly created separate sheet. The drawback to that is that you cna only drill down on one item at a time, and it is a separate sheet. HTH, Bernie MS Excel MVP "James" <an...

clip art in list box
i want to insert clip art into a drop list instead of text One word...Can't. Which technically is two words but you still can't... -- HTH... Jim Thomlinson "mrmatt67" wrote: > i want to insert clip art into a drop list instead of text ...

I am trying to write a macro using If...Then
I am trying to write a macro that will look at the value in column G. If that value is blank or zero, then select the entire row and delete it. Then I want it to populate columns A with a number "111119" and column H with "TEXT" Here's what I tried, but it's not working. (There are other sorts, etc. that precede this item in the macro, that seem to be working fine.) If Range("g:g") < 1 = true Then ActiveWorkbook.Worksheets("Tab3 Upload").Rows.Select Selection.Delete End If If Range("b:b") >...

Socket Programing using ASyncsocket
I did a Socket Programing by using AsycSocket..I used win32 MFC based application..........But Create() return zero....That is socket was not created.. Code is given below... void CCLientSocket::InitializeClient() { if (0 == Client.Create()) { MessageBox(NULL,_T("Client Socket is not created"),_T("Client Socket"),0); } else { MessageBox(NULL,_T("Client Socket is created"),_T("Client Socket"),0); } } What is the problem?????????? So where in this code did you call ::GetLastError (...

RFID Use with Access
I am looking to find the steps necessary to make Access ready to interface RFID information captured from passive RFID devices. I would appreciate anyone in the group sharing this how-to with me. Zachry1 <Zachry1@discussions.microsoft.com> wrote: >I am looking to find the steps necessary to make Access ready to interface >RFID information captured from passive RFID devices. You should really be looking to the vendor of the RFID capture devices. They should have DLLs/OCXs which you can install and sample code. VB 6 code usually works just fine in Access. Tony -- Tony Toews...

Question on the IMF filtering in exchange...
Hey I installed the IMF filter last night and it works great, with one exception. I set both thresholds to the same (5) and got almost all blocked emails into the archive that were junk...So that is good. However I had some users report that there was mail in their junk folder that should have been good Inbox mail. This I undersyand and can live with as folas-positives...the problem is, since both settings on the folter tab were set to 5, how does it know to send the mail to archive rather than Junk folder? Why wouldn't it just send them all to archive if both settings were at ...

Filtering without Filter
I just don't get the following. Any ideas? "A" row I have two different values I use: "Contact" and "Not a contact". "B" row I have the person's name (employee). "C" row I have a quantity, just one number. Now what I need is to output quantities of how many Contacts Employee1 or Employee2 or Employee3 have. Also what I need is to get the number of contacts - which can be found on row "C". Should I use COUNT.IF ? Row A can have 2 or more different values so should there be somekind of conditional IF function included? T...

mutli-select list box problem
The following code is my failed attempt to get the items picked in a multi-select List box to then appear in another form named "NameDetailForm". The NameDetailForm does open but does not show the items picked from the list box. I believe the end part of my code is flawed, but cannot figure out what it should correctly be. If there is better code for this purpose, I would appreciate seeing it. Private Sub Itemschosen_Click() Dim strWhere As String, varItem As Variant If Me!NameListBox.ItemsSelected.Count = 0 Then Exit Sub For Each varItem In Me!NameListBox.ItemsSelec...

Filtering #11
Hi, can ayone tell me how I could do the following in excel 2007 or 2010: Horse Trainer Sam M Jones John M Jones Colin S Attwater Steve J Jackson Brian B Mathers James B Mathers Martin G Raggy Patrick S Thomson What I want to do is filter the dataset on 'Trainer' so that it only shows me the Trainers who feature once in the list. So if I was to do this properly it would only show S Attwater and G Raggy as the other trainers have more than one horse..... Hopefully someone can help because it is driving me crazy !! Thanks David Give this macro a try... Sub HideDuplicateTr...

Using palm pilot and outlook
Is there a way to export my contacts and calendar to my new Sony Clie handheld? See if the information on the following page helps: http://www.slipstick.com/addins/olpda.htm -- Jocelyn Fiorello MVP - Outlook *** Replies sent to my e-mail address will probably not be answered -- please reply only to the newsgroup to preserve the message thread. *** "Paul" <paul@charter.net> wrote in message news:0cb501c368fe$a5b4b050$a001280a@phx.gbl... > Is there a way to export my contacts and calendar to my > new Sony Clie handheld? ...

How to fill up CPrintInfo without a Print Dialog Box
I can get the DEVMODE structure from a given printer name so I do not need to popup a print dialog box. However, since I do not want to override all those print functions, I will have to correctly fill up the CPrintInfo which contains the print dialog structure. Is there any way to do this? ...

Junk filter BEFORE other filters?
I am running Outlook 2003 and the Junk filter was working really well. Then I started making other filters...one of them looks for my domain name in the headers and if it's there it moves the email to a folder. Problem is, this filter seems to activate before the junk filter, so the junk sn't being filtered now! How can I set the junk filter to do it's job first and THEN to run my own rules? -- Bryan Anderson <www.anderson-it.com> I created this rule and set it as the first rule to run: Apply this rule after the message arrives with 'X-Spam-Level:******'or'...

Can you use "Like"
I am trying to set up a simple learning aide for my daughter. She has a large list of words to learn, however some of these words have several mearnings. What I wanted to do was to have the word the word in A1, the correct meaning in a hiden collumn B1, she would then type in C1 what she thought was the correct meaning. I wanted to use just a simple =IF(C1=B1, "correct","wrong") in D1 however because some answers have "multiple " meanings how can I set the formular to accept either answer A1 B1(hidden) C1 D1 porto per...

Cannot use a prefix with an empty namespace exception
I'm trying to create an XML document that can be opened in Excel. I have some simple code that ... eventually does the following elem = _doc.CreateElement("Style"); elem.SetAttribute("ss:ID","Default"); elem.SetAttribute("ss:Name","Normal"); parentElem.AppendChild(elem); to add a "Style" item with 2 attributes. My problem is that when I do a Save on the XML document I get an Attribute exception "Cannot use a prefix with an empty namespace". So (dumb question I'm sure) but I can't figure out how to make th...

Pasting into a filtered list
Can anyone tell me if it is possible to paste a list of price updates into a filtered list. - I have filtered the list to show just the products whose prices need to be updated, when I try to paste the updated prices, into the list, the prices are not just pasted into the visible cells but the hidden cells between. Can I paste into the visible cells only or do I have to update each line manually. I am using Excel 2002 Any help would be much appreciated Can you sort the list to bring the products that need updating together in the list? If not, try something like this: Your list of product...

Macro to copy a VLOOKUP formula
Hello, I was wondering if somebody could help me with this macro… I have some data with a filter on, so that only the rows with blank cells are showing. I want to enter a VLOOKUP in the cell, and copy it down to all the blank cells. I tried just recording a macro, but when I run the macro it doesn’t work. Any ideas of how to do it? Example: 1) Before the filter: Colums A -B - C A x x - 1st Row A - 2nd Row A x x - 3rd Row A - 4th row A x x - 5th row 2) After the fil...

Going from one combo to another
I have a worksheet with some combo boxes. I want to hit the tab key and move from one combo to the next one. Is that possible? How is it done? -- bernardoafs ------------------------------------------------------------------------ bernardoafs's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=28993 View this thread: http://www.excelforum.com/showthread.php?threadid=489382 Hi, if you open goto your userform properties, there is an area called Tab Index. alter the numbers to your tab preference as they are automatically set by the point you added your combo b...

Add Drive A to my Access Send To list
At predent the only place I can send my Access filr is to an email recipient. I want to Add Drive A so I can back up my work, Any suggestions please. TIA csmdave Send To is used to mail a copy of the current object (form, report, whatever). If you want to back up your work, exit Access and copy the .MDB file to drive A. Carl Rapson "csmdave" <csmdave@hotmail.com> wrote in message news:464585af$0$9973$4c368faf@roadrunner.com... > At predent the only place I can send my Access filr is to an email > recipient. > I want to Add Drive A so I can back up my work, >...