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

Display records in subform to report

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.