By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,251 Members | 2,656 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,251 IT Pros & Developers. It's quick & easy.

Need help in QUERY/REPORT in Access

P: 75
Hello~

Just a quick question about Access Reports.

I want to have a form for user where they will have two textbox and one combo box to pick from and run the query based on that.

1 txtbox is for start date
2 txt box is for end date
and combo box is for to pick the person name

I want to run a query/report when user puts start date and end date and run the report by Location Type, and also another query/report when they pick the person name and run by location and by the start date and end date.

I hope i explained well..if not..plz let me know i will try to explain better.

tblInterventions is the table name
txtstartdate
txtenddate
cmbboxnames

Thx
Sep 19 '07 #1
Share this Question
Share on Google+
6 Replies


P: 75
Hello~

Just a quick question about Access Reports.

I want to have a form for user where they will have two textbox and one combo box to pick from and run the query based on that.

1 txtbox is for start date
2 txt box is for end date
and combo box is for to pick the person name

I want to run a query/report when user puts start date and end date and run the report by Location Type, and also another query/report when they pick the person name and run by location and by the start date and end date.

I hope i explained well..if not..plz let me know i will try to explain better.

tblInterventions is the table name
txtstartdate
txtenddate
cmbboxnames

Thx
can anyone help me out please???
thx
Sep 19 '07 #2

Scott Price
Expert 100+
P: 1,384
Have you tried building a query yet?

The WHERE criteria for dates is generally a little tricky, in the design view grid you put something like this:

>="#" & Forms![YourFormName]![TextStartDate] & "#"

<="#" & Forms![YourFormName]![TextEndDate] & "#"

Get a query started, then if you run into troubles, post back here with the full sql of the query that you are using, and we'll take a look!

Regards,
Scott
Sep 20 '07 #3

P: 75
Have you tried building a query yet?

The WHERE criteria for dates is generally a little tricky, in the design view grid you put something like this:

>="#" & Forms![YourFormName]![TextStartDate] & "#"

<="#" & Forms![YourFormName]![TextEndDate] & "#"

Get a query started, then if you run into troubles, post back here with the full sql of the query that you are using, and we'll take a look!

Regards,
Scott
Thanks for your reply.

I am not how to start on this task. I have never done something like that.

I want to create a form where user can put StartDate and EndDate and report will generate based on the dates.

For example i want to create a query by location between some dates.
thats all i have so far, but i am not sure if i am on the right track.

Expand|Select|Wrap|Line Numbers
  1. Select Count(Location) As CountofLocation from tblInterventions
  2. where Datefld>=txtStartDate and <==txtEndDate;
  3.  
  4.  
Sep 20 '07 #4

Scott Price
Expert 100+
P: 1,384
Thanks for your reply.

I am not how to start on this task. I have never done something like that.

I want to create a form where user can put StartDate and EndDate and report will generate based on the dates.

For example i want to create a query by location between some dates.
thats all i have so far, but i am not sure if i am on the right track.

Expand|Select|Wrap|Line Numbers
  1. Select Count(Location) As CountofLocation from tblInterventions
  2. where Datefld>=txtStartDate and <==txtEndDate;
  3.  
  4.  

You may not need the form... A parameter query might work just as well.

Create a new query in design view. right click and show the table tblInterventions. Double click your Location field and your Datefld. Now right click again, and choose the Parameters option. Create two new parameters Called [Start Date] and [End Date], give them Date/Time properties.

After closing the Parameter dialog box, place this in the Criteria grid box below your Datefld: Between [Start Date] And [End Date]

Save and test!

Regards,
Scott
Sep 20 '07 #5

P: 75
You may not need the form... A parameter query might work just as well.

Create a new query in design view. right click and show the table tblInterventions. Double click your Location field and your Datefld. Now right click again, and choose the Parameters option. Create two new parameters Called [Start Date] and [End Date], give them Date/Time properties.

After closing the Parameter dialog box, place this in the Criteria grid box below your Datefld: Between [Start Date] And [End Date]

Save and test!

Regards,
Scott
Scott,

what should I put under Criteria Grid box?
Do i put the phsicall dates? or the query?
please let me know.

Thx
Sep 20 '07 #6

Scott Price
Expert 100+
P: 1,384
After following the other instructions I gave put this in the Criteria Grid box.

Between [Start Date] And [End Date]

Regards,
Scott
Sep 20 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.