Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Pulling full name into header of report in MS Access

Posted on 2013-01-10
7
Medium Priority
?
397 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

610 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