Solved

Pulling full name into header of report in MS Access

Posted on 2013-01-10
7
381 Views
Last Modified: 2013-01-10
I have a report that I want to do a summary at the top of the report and I am referencing form from its being executed from, but when it brings up the report I'm only getting the ID of the person instead of the full name

The dropdown in the form has two columns; [ID] and [Full_Name].  I hides the ID column and displays the Full_Name.

Property Sheet of Form:
Control Source = None

Row Source = SELECT [Printer_Names].[Printer_ID], [Printer_Names].[Full_Name] FROM Printer_Names ORDER BY [Full_Name];

Row Source Type = Table/Query

Bound Column = 1
Column Count = 2
Column Widths = 0"; 1"


Report Header:
Design Control:
="Printer From:  " & [Forms]![frmIndPrint]![Printer_Name] & "  To:  " & [Forms]![frmIndPrint]![To_Printer_Name]

Report Displays:
Printer From: 6  To:  6

How can I get this to display the Printer "Full_Name" instead of the "ID"?
0
Comment
Question by:dsheridan
  • 5
  • 2
7 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 200 total points
ID: 38763299
Try this:

="Printer From:  " & [Forms]![frmIndPrint]![Printer_Name].Column(1) & "  To:  " & [Forms]![frmIndPrint]![To_Printer_Name].Column(1) 

Open in new window

0
 
LVL 61

Expert Comment

by:mbizup
ID: 38763309
If the above doesn't work, try this instead:

="Printer From:  " & [Forms]![frmIndPrint]![Printer_Name]!Column(1) & "  To:  " & [Forms]![frmIndPrint]![To_Printer_Name]!Column(1) 

Open in new window

0
 

Author Closing Comment

by:dsheridan
ID: 38763337
That rocks.  Thank you. It was exactly what I was looking for.

Does the Column(1) look at the control in the form and take the display column instead of the hidden column? Correct?
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 61

Expert Comment

by:mbizup
ID: 38763358
That's correct...

Column numbers are zero-based, meaning your first column (the hidden ID column) is column 0.  This is what gets stored in the table your form is based on.

Column 1 is the second column, which is the actual text name that your rowsource query is selecting.  This is displayed, but not actually stored.

If you refer to a combo box without specifying the column, the default is the data that is actually stored (your numeric ID).
0
 

Author Comment

by:dsheridan
ID: 38763373
Again thank you!!!!!!!
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38763378
Glad to help :)
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38763393
Btw... another *very* simple solution to this is to copy/paste your form's combo box into your report's header instead of using textboxes.

This will display the data as you see it in your form (you'll see the full name), but the drop down arrow does not appear on reports - so it will look exactly like a textbox when you print or preview it.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question