?
Solved

Pulling full name into header of report in MS Access

Posted on 2013-01-10
7
Medium Priority
?
391 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 800 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
How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

 
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

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

777 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