Solved

Pulling full name into header of report in MS Access

Posted on 2013-01-10
7
372 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now