Solved

Pulling full name into header of report in MS Access

Posted on 2013-01-10
7
376 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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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.

914 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

18 Experts available now in Live!

Get 1:1 Help Now