473,395 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Question about Reports and choosing the records to be printed on it

2
ok, so I've hit the wall on my knowledge for VBA so I hope I can get some help here. Basically what I have right now is a table of request for funds for my dept. Those requests are then put into a report (5 items per report) and then printed. So all i could figure out was how to retrieve the last 5 entries into the table to the report, but sometimes I need to select random entrees to print. So then i created a couple checkboxes to try and keep track if something was printed...and now my report will display the 5 most recent transactions that have the Print chkBox set to True. So basically what i would like to do is enter my transactions in my form, ( i usually enter 3-5 per time) and then go directly to my report, print those 3-5 trans. and then after they are printed, have the chkBox for Print selected so they won't be displayed in the next report. Sorry if this isn't a good explanation, I'm very new to the DB world. also, im using access 2007 if that matters.
Feb 5 '07 #1
3 1332
nico5038
3,080 Expert 2GB
Instead of a yesno field I would use a numeric field with a runnumber.
Just create a query to update max five records with:

UPDATE tblRequest a SET a.RunNumber =dmax("RunNumber","tblRequest")+1 where A.RequestID IN (Select top 5 b.RequestID from tblRequest b where IsNull(b.RunNumber) order by b.requestid)

Now for the report use a query like:

select * from tblRequest where RunNumber = dmax("RunNumber","tblRequest")

Getting the idea ?

Nic;o)
Feb 5 '07 #2
dirka
2
Instead of a yesno field I would use a numeric field with a runnumber.
Just create a query to update max five records with:

UPDATE tblRequest a SET a.RunNumber =dmax("RunNumber","tblRequest")+1 where A.RequestID IN (Select top 5 b.RequestID from tblRequest b where IsNull(b.RunNumber) order by b.requestid)

Now for the report use a query like:

select * from tblRequest where RunNumber = dmax("RunNumber","tblRequest")

Getting the idea ?

Nic;o)
Getting the idea?? good one, lol

i am really just learning this stuff so I need a little more help..here is a little more info and maybe you could clarify for me.
I have a table "requisitions" a query "requisition report query" and a report "requisition report"

Here is what i have for the query right now:
Expand|Select|Wrap|Line Numbers
  1. SELECT TOP 6 Requisitions.ID, Requisitions.Quantity, Requisitions.Title, Requisitions.Vendor, Requisitions.[Cost/Unit], Requisitions.Date, Requisitions.[Real Cost], Requisitions.RechNum, Requisitions.ReportID, Requisitions.Description, Requisitions.Print
  2. FROM Requisitions
  3. WHERE (((Requisitions.Print)=-1))
  4. ORDER BY Requisitions.ID DESC;
  5.  
Since I can't explain worth a damn, here are some pics of what I have so far...
http://img444.imageshack.us/img444/817/tblreqhd3.jpg
http://img213.imageshack.us/img213/2...reqinfooh9.jpg
http://img154.imageshack.us/img154/5246/qryreqnv4.jpg
http://img379.imageshack.us/img379/7650/repreqfr7.jpg

I hope these help, like i said, i just want to add new items, print them, and then not have them show up again in the report again when i add the next items. I really want to learn this stuff so i hope you can explain this in very lamen's terms...

thanks
Feb 6 '07 #3
nico5038
3,080 Expert 2GB
Start with changing the datatype of the Printed field into a number.
Next open a new query, ignore the table popup form and switch to SQL view.
There copy/paste:

UPDATE Requisitions a SET a.Printed =NZ(dmax("Printed","Requisitions"))+1 where A.ID IN (Select top 6 b.ID from Requisitions b where IsNull(b.Printed) order by b.ID)

Save the query named qryUpdate6 and to be sure copy/paste your table to have a backup, than try the query by running it to see the effect.

Finally use a query like the one proposed to select only the MAX Printed value.

Nic;o)
Feb 6 '07 #4

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

Similar topics

13
by: kristoff plasun | last post by:
I have a problem with a C++ DCOM application that prints Crystal Reports with data from Oracle. The SQL query is relatively complex but when the report is printed from the Crystal Reports...
9
by: אלחנן | last post by:
hi.. i don't know if this is the right group for this.. i have a small application which involves a windows service, and web services which bascally retrieves files, process them and zips them...
6
by: Tim | last post by:
Hello everyone. I visit this board pretty regularly but have never posted. My question is an application architecture question... so hopefully it's okay to post in the dotnet general forum. I...
0
by: Ian | last post by:
(Sorry if I have repeated this, it did not appear the first time) I have the following code on a button. The idea is that when this button is clicked it prints several reports automatically then...
3
by: Lumpierbritches | last post by:
Thank you in advance for any and all assistance. I'm trying to create a report that will work similar to the label wizard in Access. I have a premade form I'm attempting to fill with data from the...
6
by: NOSPAMrclark | last post by:
I'm wondering . . . . What is the generally accepted method for calling reports from multiple locations? Example: REPORT-A is called by selecting a record in a listbox and clicking a...
3
by: David | last post by:
Hi, I have an asp page which lists records out in rows Each record has a checkbox with a value parameter equal to the RecordID When the form is run, it goes to a page which I am trying to...
0
by: Andy Baker | last post by:
All of the reports in our VB.NET 2003 application are printed on blank A4 paper, and Crystal Reports XI is used to create all the forms, logos etc on the report. We have a new user who wants to...
7
by: google | last post by:
I am trying to automate the way reports are printed in an Access 2003 database - I have ~200 records (people) who require between 5 and 10 customized reports (depending on values within certain...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.