473,562 Members | 2,673 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filter multiple results by user input

I have created an append query that pulls information from one
database, and will append the selected information into a new table.
The fields are setup like 'number' 'category' 'code' 'shares' and
'dollars'. Using the "backend" of this table I can filter the numbers
by right clicking and using Filter For: then enter 1 or 2 or 3 and
this will return results for all information that has 1 or 2 or 3 as a
number.

However, the problem I have is that other users will be using this
form by a macro and will be requested to input all the necessary
information because I don't want them messing around in the tables. I
have created a filter query to try to filter the 'number' field and my
criteria reads [Enter: number] but this only allows the user to enter
one number and then the query will execute. Therefore, the user will
only have information that had 1 as a number.

What would be a better criteria to use to allow the user to input
multiple numbers (like I did in the Filter For: 1 or 2 or 3) and have
the query return all the results requested?

Oct 31 '07 #1
1 2840
On Oct 31, 4:43 pm, Barb.Richa...@g mail.com wrote:
I have created an append query that pulls information from one
database, and will append the selected information into a new table.
The fields are setup like 'number' 'category' 'code' 'shares' and
'dollars'. Using the "backend" of this table I can filter the numbers
by right clicking and using Filter For: then enter 1 or 2 or 3 and
this will return results for all information that has 1 or 2 or 3 as a
number.

However, the problem I have is that other users will be using this
form by a macro and will be requested to input all the necessary
information because I don't want them messing around in the tables. I
have created a filter query to try to filter the 'number' field and my
criteria reads [Enter: number] but this only allows the user to enter
one number and then the query will execute. Therefore, the user will
only have information that had 1 as a number.

What would be a better criteria to use to allow the user to input
multiple numbers (like I did in the Filter For: 1 or 2 or 3) and have
the query return all the results requested?
I hope I understand your question correctly.
I am going to assume that you would like to avoid using code do this -
so we'll try although we'll need to add one command.
Let's call the table that holds your data tInfo.
Create a local table (not on the backend so each user will have their
own separate copy) and call it tCriteria
tCriteria has one field 'Number' (although I would not name it that,
it is a reserved word).
Create a continuous form - let's call it fCriteria. It will show the
data from tCriteria
Create a continuous form - let's call it fInfo.
fInfo's recordsource should be tInfo linked to tCriteria by the
'number' field.
Create a 'single form' view form and call it fMain.
Put both fCriteria and fInfo as subforms in fMain.
Here is the only code:
Go into the properties of fCriteria (make sure it's this form and
not fMain),
go to the events tab,
choose afterupdate,
choose [event procedure],
click on the elipsis (the buton with 3 dots on the end) and it will
take you to a code window.
Your code should look like
Private Sub Form_AfterUpdat e()
me.parent.refre sh
End Sub
Do the same thing for 'After Del Confirm'
Your code should look like
Private Sub Form_AfterDelCo nfirm(Status As Integer)
Me.Parent.Refre sh
End Sub

Now when you open fmain you can type a number into fCriteria subform
and the data will show in fInfo subform.
Delete the numbers you don't want to see from fCriteria.
Now you can adjust the size and format of your subforms so that
everything looks nice and is an easy size to use.

If you are already proficient in code, you can do something similar,
more elegantly, using a list box and multi selecting items.
Good luck
P



Nov 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
4068
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
1
2389
by: Edward Burns | last post by:
I am trying to create an events calendar with a complete month view. I want to be able to get all the events for a particular month, using only one recordset on the page then be able to loop through each day of that month and output the events for a particular day for each day without having to open up 28 to 31 different recordsets. The...
0
6460
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the report are based on the same View addressed in the Record Source of both as 'dbo.CLMain_vw'. The View resides in a SQL Server 2000 database. There are...
2
2600
by: Terry | last post by:
I have cerated a Form, ExamsFrm, which is used to input details of exams taken at several Centres. It dosplays details from StudentTbl and has a SubForm which displays details from ExamsTble. I have incorporated some VB6 code as well as some Conditional Formatting. The code automatically updates CheckBoxes in the SubForm, depending on exam...
2
4387
by: Seth Delaney | last post by:
I have a form with multiple unbound text boxes which serves as a "search form". I can enter my search parameters in the various boxes as needed and click okay. My records are then filtered to produce the results I want in a separate form (filter by form). No problem, except I want to save the sql to a query, not a form. When I debug.print...
3
2702
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only allows me to filter based on variables in a single table. I would like to have a search form where I can select multiple variables (from various...
1
4143
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only allows me to filter based on variables in a single table. I would like to have a search form where I can select multiple variables (from various...
6
7017
by: jmarcrum | last post by:
Hi! I have created a Union Query in ACCESS 2003, that combines 130 records from one query (Extra Foreman Radios) and 250 records from another query (Forman Main Radios). I have created a continuous form and used the Union query (qryRadioDataUnion) as my record source. My question is...how would i apply a filter to that query record source to...
1
6783
by: woodey2002 | last post by:
Hi Everyone and many thanks for your time.. I am trying to begin access and a bit of VBA i am enjoying it but I have a annoying problem I just can’t get any where on. My databse mostly includes bits of code for different examples. I have one last thing to finish. I am trying to create a search form that will allow users to select criteria from...
0
7655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7577
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7869
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7627
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6221
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3623
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3608
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2073
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1191
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.