Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

record criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AttackIP - 09 Nov 2005 19:40 GMT
I have a table of members all of whom have a unique membership number.  I
need a query to pull records on several members at once by the membership
number. i.e. a criteria like (1131, 1326, 3815...)  I would need to enter
multiple various (not random) mem numbers on a form, and query those records.
I can query them individually, or get all records Between any two records;
but that's not what I need here...  Help

Thanks!
giorgio rancati - 09 Nov 2005 20:14 GMT
Hi AttackIP,

try this query
----
SELECT *
FROM Table1
Where ',' & Forms!MyForm!txtCriteria & ',' LIKE '*,' & [membership number] &
',*'
-----
for example, the values in txtCriteria are "1131, 1326, 3815"

I  hope to have understood  :-)

bye
Signature

Giorgio Rancati
[Office Access MVP]

> I have a table of members all of whom have a unique membership number.  I
> need a query to pull records on several members at once by the membership
[quoted text clipped - 4 lines]
>
> Thanks!
Ofer - 10 Nov 2005 00:28 GMT
I think that what you looking for is

Select * from TableName Where memberNum In ( (1131, 1326, 3815)

Signature

The next line is only relevant to Microsoft''s web-based interface users.
If I answered your question, please mark it as an answer. It''s useful to
know that my answer was helpful
HTH, good luck

> I have a table of members all of whom have a unique membership number.  I
> need a query to pull records on several members at once by the membership
[quoted text clipped - 4 lines]
>
> Thanks!
AttackIP - 10 Nov 2005 00:40 GMT
OK good, now how do I run that query from a form that my non-Access
knowledgable users can utilize?

> I think that what you looking for is
>
[quoted text clipped - 8 lines]
> >
> > Thanks!
giorgio rancati - 10 Nov 2005 07:12 GMT
Hi Ofer,
no, if you want to put the criteria in a textbox, it is necessary to use the
Like or the Instr function.

bye
Signature

Giorgio Rancati
[Office Access MVP]

> I think that what you looking for is
>
> Select * from TableName Where memberNum In ( (1131, 1326, 3815)
giorgio rancati - 10 Nov 2005 07:24 GMT
> Hi Ofer,
> no, if you want to put the criteria in a textbox, it is necessary to use the
> Like or the Instr function.

I see that it was not asked for :-)

bye
--
Giorgio Rancati
[Office Access MVP]
Ofer - 10 Nov 2005 07:26 GMT
Hi Giorgio
For thts certain criteria, where there are few nubers to filter on, and
there are no rules or order, I can't see how you can use anything but the In()
If we need to use the criteria from a Text box, to display the query with
the right filter, I would change the SQL of the Query after the user enter
the critera 1,4,8,22,44,66

Application.CurrentDB.QueryDefs("QueryName").Sql = "Select * From TableName
Where FieldName In (" & Me.TextBox & ")"

> Hi Ofer,
> no, if you want to put the criteria in a textbox, it is necessary to use the
[quoted text clipped - 4 lines]
> >
> > Select * from TableName Where memberNum In ( (1131, 1326, 3815)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.