Solved

AddAllToList on search form

Posted on 2011-03-09
4
505 Views
Last Modified: 2012-05-11
I have a search form that has text boxes and a list box. Everything works great on my search form.

I have added the AddAllToList function to add all to the listbox. All is in the listbox but I am having trouble getting my form to show all records. I put the below code into my on click event of my button but it doesnt seem to work.

 
Private Sub Btn_Search_Click()

If Me.LstAnalystName = "(ALL)" Then
Me.Frm_Search2.Form.RecordSource = "SELECT * FROM qry_AllData "

Else
   ' Update the record source
    Me.Frm_Search2.Form.RecordSource = "SELECT * FROM qry_AllData " & BuildFilter
End If
    
    ' Requery the subform
    Me.Frm_Search2.Requery

End Sub

Open in new window


I did something similar to this on another form with a combo box and it works fine. However that form is not a search form. I am having trouble with it on my search form.
 
Any help is appreciated.

Kelly
0
Comment
Question by:kmoyer9717
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
MINDSUPERB earned 500 total points
Comment Utility
Try to check the Column bound and the column count property of you list box.

You may try

If Me.LstAnalystName.Column(1) = "(ALL)" Then


Sincerely,
Ed
0
 

Author Closing Comment

by:kmoyer9717
Comment Utility
This worked perfectly.

Thanks so much for your help.

Kelly
0
 

Author Comment

by:kmoyer9717
Comment Utility
I may have spoke to soon. That worked perfectly to get the All however when I choose another analyst name to search in my list box before it returns the result i get an error "AddAllToList" "Item not found in this collection"
0
 
LVL 19

Expert Comment

by:MINDSUPERB
Comment Utility
Kelly, you are welcome.

Can you post the code of your AddAllToList function?

Ed
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now