473,770 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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!Over due_sub.Form!Pa rt_No & "'
"
MyReport = "select * from overdue_qry " & _
"where" & "[Job_order] = '" &
Forms!main!Over due_sub.Form!Jo bid
& "'" & " and " & partid

DoCmd.OpenRepor t "overdue_print" , acViewPreview, MyReport

Regards,
Daniel
Nov 12 '05 #1
3 2042
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!Over due_sub.Form!Pa rt_No & "'
"
MyReport = "select * from overdue_qry " & _
"where" & "[Job_order] = '" &
Forms!main!Over due_sub.Form!Jo bid
& "'" & " and " & partid

DoCmd.OpenRepor t "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.OpenRepor t "YourReport",,s trWhere
strWhere = "[JobId] = & Me.JobID
'since strWhere is not blank, show only the records for that job
Docmd.OpenRepor t "YourReport",,s trWhere
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.OpenRepor t? It's simple enough to remove

& "[Job_order] = '" & Forms!main!Over due_sub.Form!Jo bid
& "'" & " 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.goo gle.com...
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!Over due_sub.Form!Pa rt_No & "'
"
MyReport = "select * from overdue_qry " & _
"where" & "[Job_order] = '" &
Forms!main!Over due_sub.Form!Jo bid
& "'" & " and " & partid

DoCmd.OpenRepor t "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*****@localh ost.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.OpenRepor t? It's simple enough to remove

& "[Job_order] = '" & Forms!main!Over due_sub.Form!Jo bid
& "'" & " 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.goo gle.com...
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!Over due_sub.Form!Pa rt_No & "'
"
MyReport = "select * from overdue_qry " & _
"where" & "[Job_order] = '" &
Forms!main!Over due_sub.Form!Jo bid
& "'" & " and " & partid

DoCmd.OpenRepor t "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
8410
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 number changes fine. Within this main form I have a subform detailing distribution records for the contact (main form is based on this) that also has navigation buttons and a label showing Distribution 1 of ##. This is where the problem lies. The...
3
2936
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 represents a day of the week, and the code appends a record starting with Monday and finishing with Sunday. After appending the 7 records to a table I then refresh the screen and display the records in a subform for the user to edit. What happens...
2
1777
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 number of complaint follow-ups and any number of actions or outcomes against the case. Each of these have different forms, with the case number being the connecting key, and a date/time field.
4
2647
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 Access help and it gave me the following code, which I have adapted for my database and it works well as a SINGLE FORM. Option Compare Database Private Sub Form_Current()
3
8086
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 incur numerous service problems “Events”. Each morning we have a global conference call where events which occurred within the previous 24 hours are discussed. Prior to the call, an analyst has to review these events and provide a report, ‘The Morning...
3
5388
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 records the subform's table has. I cannot put the subform as Data Entry because I cannot print the main form & subform together if the subform is "data entry". (comes up blank every time)
2
16683
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, one sub). That code is working properly. How do I get that to translate to my report? I use VBA code because I use formats other than BMP for the pictures. Would basing the form on the qury that the report is based on solve the issue without...
7
2051
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 be copied and duplicated back in the original underlying table for that subform. To give a bit more background, the main form contains records of individual ‘reports’ (held in table called CPG1) and the subform (CPG3_Subform) identifies the...
5
2622
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 Names from a table (Staffers) which contains staffers’ names and other info. When the user actually selects a Staffer Name from the dropdown combo box, the VBA routines for the combo box’s On Enter and After Update events take care of finding and...
0
10257
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9904
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8931
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.