Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 14th, 2005, 04:55 AM
Utarian Utarian is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 11 Utarian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 55 sec
Reputation Power: 0
help in query ..

I have attatched an mdb file here.
I am doing the report by query, I wonder why access ask me to enter parameter value for DocNo, Date, Time while i never set parameter to them ( DocNo, Time, Date) in the query.
The resulf of query for the report is correct but there should not have any parameter to ask for DocNo, Date, Time.

open form > input_check(II)
transaction = REC
document no from A 00001 to A 00003

Anyone can help me please?
Thanks a lots.
Attached Files
File Type: zip question.zip (34.6 KB, 202 views)

Reply With Quote
  #2  
Old April 21st, 2005, 02:11 PM
MarkL23 MarkL23 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 9 MarkL23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 22 m 34 sec
Reputation Power: 0
Well, here's the short answer: You're doing a Report based off of a query, based off of another query, based off of input from a form. I believe that this is your problem. Your report is calling on the recordset of a query. That query gets it's values from a recordset of another query, which in turn gets IT'S recordset from a form. I believe your getting prompted for data because the second query is trying to process data from the first when the first hasn't been run. Following the principles of K.I.S.S., I found that I could get all the data I needed for the report in one query, and the SQL statement for that query is listed below:

SELECT DISTINCT Detail.ScrapCode, Sum(Detail.Weight) AS SumOfWeight, Detail.Comment, Detail.YY, Detail.MM, Master.CYR, Master.CMonth
FROM Master INNER JOIN Detail ON Master.DocNo = Detail.fDocNo
WHERE (((Master.DocCode)=[Forms]![input_check(II)]![txtCode]) AND ((Master.TransCode)=[Forms]![input_check(II)]![txtTrans]) AND ((Master.DocNo) Between [Forms]![input_check(II)]![txtFrm] And [Forms]![input_check(II)]![txtTo]))
GROUP BY Detail.ScrapCode, Detail.Comment, Detail.YY, Detail.MM, Master.CYR, Master.CMonth;

To use this, make a new query in design view, switch to SQL view, paste this statement, and save. Then, build your report off of this query.


On a side note, having the primary key in a table where repeats are allowed is generally a bad idea. You may be able to get by in a relatively small database, but if this particular one gets to be fairly complex, you're really going to start running into problems trying to get the data you need.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > help in query ..


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT