473,387 Members | 1,693 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,387 software developers and data experts.

Display records in subform to report

Hi, i got a subform and inside got some records. But i want to press a
button and make all those records to a report. It only display all
those records with same Job Order no. I want to display all job order
no. and part. Pls advise.

partid = " [part_no] = '" & Forms!main!Overdue_sub.Form!Part_No & "'
"
MyReport = "select * from overdue_qry " & _
"where" & "[Job_order] = '" &
Forms!main!Overdue_sub.Form!Jobid
& "'" & " and " & partid

DoCmd.OpenReport "overdue_print", acViewPreview, MyReport

Regards,
Daniel
Nov 12 '05 #1
3 2015
Daniel Tan wrote:
Hi, i got a subform and inside got some records. But i want to press a
button and make all those records to a report. It only display all
those records with same Job Order no. I want to display all job order
no. and part. Pls advise.

partid = " [part_no] = '" & Forms!main!Overdue_sub.Form!Part_No & "'
"
MyReport = "select * from overdue_qry " & _
"where" & "[Job_order] = '" &
Forms!main!Overdue_sub.Form!Jobid
& "'" & " and " & partid

DoCmd.OpenReport "overdue_print", acViewPreview, MyReport

Regards,
Daniel


Create your report with a recordsource without a filter on the JobID.

Dim strWhere As String
'since strWhere is blank, show all
Docmd.OpenReport "YourReport",,strWhere
strWhere = "[JobId] = & Me.JobID
'since strWhere is not blank, show only the records for that job
Docmd.OpenReport "YourReport",,strWhere
Nov 12 '05 #2
Help me understand -- if you don't want the records limited by Job_Order,
why do you include it as a criteria in the Filter property of the
DoCmd.OpenReport? It's simple enough to remove

& "[Job_order] = '" & Forms!main!Overdue_sub.Form!Jobid
& "'" & " and "

from the statement that sets the value of "My Report".

Perhaps I have misunderstood. If so, please follow up with a clarification.

Larry Linson
Microsoft Access MVP
"Daniel Tan" <da*******@time.net.my> wrote in message
news:6a**************************@posting.google.c om...
Hi, i got a subform and inside got some records. But i want to press a
button and make all those records to a report. It only display all
those records with same Job Order no. I want to display all job order
no. and part. Pls advise.

partid = " [part_no] = '" & Forms!main!Overdue_sub.Form!Part_No & "'
"
MyReport = "select * from overdue_qry " & _
"where" & "[Job_order] = '" &
Forms!main!Overdue_sub.Form!Jobid
& "'" & " and " & partid

DoCmd.OpenReport "overdue_print", acViewPreview, MyReport

Regards,
Daniel

Nov 12 '05 #3
Basically what i'm trying to do is to generate reports from all the
records based in my subform. Do you have any idea how to do it ?
Thanks.

Regards,
Daniel

"Larry Linson" <bo*****@localhost.not> wrote in message news:<Xr************@nwrddc01.gnilink.net>...
Help me understand -- if you don't want the records limited by Job_Order,
why do you include it as a criteria in the Filter property of the
DoCmd.OpenReport? It's simple enough to remove

& "[Job_order] = '" & Forms!main!Overdue_sub.Form!Jobid
& "'" & " and "

from the statement that sets the value of "My Report".

Perhaps I have misunderstood. If so, please follow up with a clarification.

Larry Linson
Microsoft Access MVP
"Daniel Tan" <da*******@time.net.my> wrote in message
news:6a**************************@posting.google.c om...
Hi, i got a subform and inside got some records. But i want to press a
button and make all those records to a report. It only display all
those records with same Job Order no. I want to display all job order
no. and part. Pls advise.

partid = " [part_no] = '" & Forms!main!Overdue_sub.Form!Part_No & "'
"
MyReport = "select * from overdue_qry " & _
"where" & "[Job_order] = '" &
Forms!main!Overdue_sub.Form!Jobid
& "'" & " and " & partid

DoCmd.OpenReport "overdue_print", acViewPreview, MyReport

Regards,
Daniel

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Carl | last post by:
I have a main form with navigation buttons on it and a label showing for example Record 1 of 15 using recordsetclone on it and eveything works fine. When I move through the records the record...
3
by: SJM | last post by:
I have a problem that occurs occasionally with a db for a undetermined reason which I would love to solve. I construct and append a series of 7 records to a table using ADO recordset. Each record...
2
by: joan.edington | last post by:
Hi, I've not done a lot of MS Access work and have been tasked with creating a database to record and report on stages of complaints cases. Each set of records for a case has a header, any...
4
by: vidiot | last post by:
I am trying to create a subform that will display images related to the parent form. The subform is a continuous form as there will be several images that relate to the parent form. I checked...
3
by: wvmbark | last post by:
First time poster... I just found this forum and it appears there's plenty of people here that could make short work of problem that's been driving me absolutely bonkers for months. Every day we...
3
by: paquer | last post by:
On my Main form I have a Command Button that opens a Subform in order to create a new Subform record. At this point I want the subform to show only the new record being created. Not all the...
2
by: smorrison64 | last post by:
I have a form that is coded to open a File Dialog boc to pick a picture to display on that particular item on a subform. My form is not based on query, but rather two separate tables (one primary,...
7
by: Albennett | last post by:
Hello. I’m new to writing VBA code but getting there thanks, for the most part, to the excellent advice on this site. I trying to create the code which will allow all records from a subform to...
5
by: JHite | last post by:
I’m using Access 2003 on Windows XP. I have a Mainform (Staff Entry) which displays an unbound combo box named ChooseStaff. The Row Source for this combo box is a SELECT of the UserIDs and Staffer...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.