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 / July 2006

Tip: Looking for answers? Try searching our database.

two parametre in one query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zila - 28 Jul 2006 17:38 GMT
How to create two parametre in one query. l hope it will  help users to get  
data for a month or for a year

Thanks in advance
John Vinson - 28 Jul 2006 19:45 GMT
>How to create two parametre in one query. l hope it will  help users to get  
>data for a month or for a year
>
>Thanks in advance

To put two parameters in one query... put two parameters in one query.

I guess I don't understand the question. What's the structure of your
table? If the user responds with a month, or with a year, what do you
want to happen?

                 John W. Vinson[MVP]
zila - 29 Jul 2006 01:52 GMT
thanks john, l solve my problem already about the date but l still have 2
problems.

1. l have a field about student name,class name, book's name and etc.
in criteria  l suggest to create 2 parametre ,may l do like this;
student name ;  class name
[type student name]and[type class name]

2. May l change a litte bit on my data type at my table .
Detail;
Field Name ; Number.
Data type ; Auto number  and l would like to change it to number. without
damage
my queries and reports.Unfortunately , l was create my query and my report
before
l create form. When l test it's not look like what l expected it.

Thanks in advance  

> >How to create two parametre in one query. l hope it will  help users to get  
> >data for a month or for a year
[quoted text clipped - 8 lines]
>
>                   John W. Vinson[MVP]    
John Vinson - 29 Jul 2006 03:00 GMT
>thanks john, l solve my problem already about the date but l still have 2
>problems.
[quoted text clipped - 3 lines]
> student name ;  class name
>[type student name]and[type class name]

No.

In SQL it would be

WHERE [Student Name] = [Type Student Name] AND [Class Name] = [Type
Class Name]

This will return the record only if the user enters *both* a student
name and the name of a class that student is in. Change AND to OR if
you want to return all the classes that the entered student is in,
along with all the students enrolled in the entered class.

In the Query Grid you would just put the [Enter Student Name] on the
query grid Criteria line underneath the [Student Name] field. If you
want to use AND put [Enter Class Name] on the same row of the grid;
for OR logic put it on the next grid line down.

>2. May l change a litte bit on my data type at my table .
>Detail;
[quoted text clipped - 4 lines]
>before
>l create form. When l test it's not look like what l expected it.

Changing the datatype to number shouldn't affect the queries on data
that is already there. It will make adding new records a bit different
since you will need to (manually or with VBA code) enter a unique ID
value whenever you add a new record. What's changed? What did you
expect, and what are you getting?

                 John W. Vinson[MVP]
zila - 29 Jul 2006 16:46 GMT
Hi John,
Thank you for your help. lt's good enough help me to finish my assigment
especially  your VBA code. l'm weak with VBA.

> >thanks john, l solve my problem already about the date but l still have 2
> >problems.
[quoted text clipped - 37 lines]
>
>                   John W. Vinson[MVP]    
John Vinson - 29 Jul 2006 18:46 GMT
>Hi John,
>Thank you for your help. lt's good enough help me to finish my assigment
>especially  your VBA code. l'm weak with VBA.

I hope you're not on the wrong track here Zila - I did not post any
VBA code at all!

                 John W. Vinson[MVP]
 
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.