473,832 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding columns from another table to a report

114 New Member
Hi to all. I hope someone can provide me with a solution to my problem. I have a Inventory master table that is used to produce a report.

Currently a form is used so that either part of the item number or item description is entered and a search button is clicked. VBA checks to make sure that something is in either of these fields and then a query is run that loads a list box on this form.

Clicking on one or more items shown in the list box and followed by clicking on a button "Print Report" causes VBA to build a string and pass it to the report.

What I need to do now is printing the location name and address that is in a table called locations. The inventory master has a loc_id column that matches the loc_id primary key in the location table. Relationship shows the connection of the two tables on this loc_id.

How do I retrieve this information? I need to be able to print something like location.loc_na me, locations.loc_a ddr on this report.

Someone know how to do this. Thanks in advance.
Mar 11 '07 #1
5 2611
ADezii
8,834 Recognized Expert Expert
Hi to all. I hope someone can provide me with a solution to my problem. I have a Inventory master table that is used to produce a report.

Currently a form is used so that either part of the item number or item description is entered and a search button is clicked. VBA checks to make sure that something is in either of these fields and then a query is run that loads a list box on this form.

Clicking on one or more items shown in the list box and followed by clicking on a button "Print Report" causes VBA to build a string and pass it to the report.

What I need to do now is printing the location name and address that is in a table called locations. The inventory master has a loc_id column that matches the loc_id primary key in the location table. Relationship shows the connection of the two tables on this loc_id.

How do I retrieve this information? I need to be able to print something like location.loc_na me, locations.loc_a ddr on this report.

Someone know how to do this. Thanks in advance.
__1. Add the Locations Table to the underlying Query (RecordSource). Make sure the Relationship, via [loc_id] , exists between the 2 Tables.
__2. Add [loc_name] and [loc_addr] to the Query Grid.
__3. Add 2 Text Boxes to the Report and set their Control Sources to the newly added Fields.
Mar 11 '07 #2
ljungers
114 New Member
__1. Add the Locations Table to the underlying Query (RecordSource). Make sure the Relationship, via [loc_id] , exists between the 2 Tables.
__2. Add [loc_name] and [loc_addr] to the Query Grid.
__3. Add 2 Text Boxes to the Report and set their Control Sources to the newly added Fields.
Thanks for the reply. The relationship between the 2 tables exist on the [loc_id].

I don't think that would work in this case. Reason I say this is because the Query is used to load the list box prior to selection. Selected row(s) are passed from the list box to the Report. The string contains the item_id, description, and the primary key [rec_id] (it's in list box, but hidden ). The report uses that [rec_id] to fetch the row in the Inventory Table for printing. The report is called via VBA using the "DoCmd.OpenRepo rt stDocName, , , strWhere" command.

I am wondering if the report should be performing the lookup of the [loc_id] in the Location Table using the [loc_id] found in the Inventory Table.

Thats what I'm not sure of or how it would be done, unless there is another way to do this. I'm new to Access and it's report features.

Thanks again.
Mar 11 '07 #3
ljungers
114 New Member
Anyone know how to work with expression builder in Report? I need some help.
Mar 11 '07 #4
nico5038
3,080 Recognized Expert Specialist
As the locationID is already available, I would propose to use a subreport.
Just place a new subreport and follow the wizard. The wizard will propose to link the subreport to the master report and accept that.
Now Access will synchronize the subreport and collect the needed data.

Getting the idea ?

Nic;o)
Mar 11 '07 #5
NeoPa
32,584 Recognized Expert Moderator MVP
Hi to all. I hope someone can provide me with a solution to my problem. I have a Inventory master table that is used to produce a report.

Currently a form is used so that either part of the item number or item description is entered and a search button is clicked. VBA checks to make sure that something is in either of these fields and then a query is run that loads a list box on this form.

Clicking on one or more items shown in the list box and followed by clicking on a button "Print Report" causes VBA to build a string and pass it to the report.

What I need to do now is printing the location name and address that is in a table called locations. The inventory master has a loc_id column that matches the loc_id primary key in the location table. Relationship shows the connection of the two tables on this loc_id.

How do I retrieve this information? I need to be able to print something like location.loc_na me, locations.loc_a ddr on this report.

Someone know how to do this. Thanks in advance.
Larry,
Please don't post the same question twice (Can't get second table data to show in report). This just makes it more difficult for everyone involved. If you need to clarify a question, please include that clarification in the original thread.
Mar 12 '07 #6

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

Similar topics

2
14952
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data in the format that I need it in order to create the reports that we use. So far this has proven to be successful for the reports that I am doing and the data that I am pulling into it. I just have one challenge that may require a lot of work and I...
1
1333
by: Marius Kaizerman | last post by:
Hi, I'm working with access and sql server. I have two tables. Fields in table #1: barcode (unique),transfer_to,quantity_of_items,supplier,price,date_of_shipment Fields in table #2: barcode (unique),transfer_to(unique),quantity_of_items The first table is updated manually using a form, and the second should be updated by the form itself at the end of each record.
13
2703
by: Shannan Casteel via AccessMonster.com | last post by:
I set up two tables (one with the regular claim info and another with ClaimNumber, PartNumber, and QuantityReplaced). The ClaimNumber is an autonumber and the primary key in both tables. I made a one to one relationship between the two tables. I have a form for the parts. It includes 25 text boxes for both the part numbers and the quantities, so 50 total. I set the control sources for each of the part number text boxes to PartNumber...
4
1555
by: Sam | last post by:
Hi, I'm adding columns to a datatable as followed. The values are from textboxes or comboboxes. The first column is properly field but then all the subsequent columns just contain "", whereas the source txtboxes or comboboxes values are correct. Why is that ? thx Dim dt As New DataTable
1
4293
by: travismorien | last post by:
I have four tables of different "entities". One table contains information for "people", one for "trusts", one for "companies" and one for "self managed super funds". Each type of entity has an autonumber ID, "Person ID" "Trust ID" "Company ID" and "SMSF ID" A "portfolio" table holds information about what shares, funds and properties everyone owns. But because its organised by "PersonID" it currently only can hold information for...
5
1894
by: John Bokma | last post by:
I have a table A, with two ID columns. In a report both ID colums should be shown with the actual value stored in a second table, B The problem is, both IDs need to be looked up in B, but are not in the same row. How do I do this in an efficient way? A sub select? Thanks,
0
1676
by: Abhishek Rodrigues | last post by:
Hi All, I am trying to create a report which has dynamic columns. i.e. the columns will be known only at the run time. How do I add the columns at the runtime in Crystal reports. Apart from Cross Tab is there any other solution for creating the dynamic columns.
3
8092
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...
5
3442
by: =?Utf-8?B?Y2RiaWdncw==?= | last post by:
Hi, I've been tasked to write a windows app that allows people to enter transactions. For each transaction, there can be an unknown number of items, and as a person enters an item, the program asks if there are more items. If yes, a new set of input boxes are created dynamically. What I was wondering is this - not knowing how many items are going to be entered, is there a way that I can change the layout of a database table depending...
1
1664
by: ikuyasu | last post by:
Hi, I am trying to create a report that takes a value from the field on a table as a group category. But The value on the report takes an id number (auto increment, and the first column) instead of second column. It is because the table takes a value from another table which takes a value from another table by a combo box selection. If I don't group on report, then this problem doesn't occur.
0
9642
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10780
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...
1
10540
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10212
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...
1
7753
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
6951
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
5623
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...
1
4421
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.