Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 21st, 2005, 03:55 PM
Authorized User
 
Join Date: Jan 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Display Label for first record only in report

I have a report containing employee and project information. The problem I'm having is that the format my boss wants I have not been able to solve.

Right now I have all the project info in the detail sectino so it displays like this

lblProject 1
lblProject 2
lblProject 3
lblProject 4

I need it to display like this

lblProject 1
             2
             3
             4

The lable and the first record have to be on the same line. Is there a way I can only show the label (lblproject) for the first record?

 
Old January 22nd, 2005, 05:49 AM
Authorized User
 
Join Date: Jul 2003
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Suggest you create a temp table of the data, delete the redundant info and then use temp table for report

Cheers Ray
 
Old January 24th, 2005, 09:50 AM
Authorized User
 
Join Date: Jan 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Its not that I am trying to weed our redundant information in a table. Its a label that is on a report that is in the detail section of the report and I need it only to show up for the first record. My boss wants the first record and the label of that section to be on the same line, so it looks like this

Relevant Experience: 1
                      2
                      3
                      4
                      5

and right now it shows like this:

Relevant Experience: 1
Relevant Experience: 2
Relevant Experience: 3
Relevant Experience: 4
Relevant Experience: 5

Relevant Experience is a label on the report. I tried using the finding the record number but I was not sure of the code to use. But I keep getting Run-Time error 2593: THis feature is not available in an MDB.


 
Old January 24th, 2005, 04:54 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

If the project number itself is in a textbox, e.g. txtProjNo, and the corresponding label is called, e.g. lblProjNo, you could do this on a report's detail section's ON FORMAT event

Me.lblProjNo.Visible = (Me.txtProjNo = 1)

This will make it invisible except for when the project number is one.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old January 25th, 2005, 08:57 AM
Authorized User
 
Join Date: Jan 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What I am doing is where you can select an employee from a combo box on a form and then a list box populates with with all the projects that employee has worked on. Then I am using:

DoCmd.OpenReport "rptCustomResume", acViewPreview, , strFilter

to open the report and strFilter is a string that has all the projects that where selected in the list box.

that looks like this.

[EPRproid] in ('1','2,'3')

And the projects are listed in alphabetical order on in the report.

So I dont know if there is a way to take that string and figure out which one comes first from alphabetical order or if there is a way to just find the first record. I have had no luck yet.
Thanks for the Responses.

 
Old January 25th, 2005, 11:17 AM
Authorized User
 
Join Date: Jul 2003
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I still think it is easier to collect the info you need in a temp table with 2 columns: e.g. ProjectID & Info.
Arrange the Info data in the order you require and then add the ProjectID text in record 1 only.
Use this table as the basis of the report.

Cheers Ray
 
Old January 26th, 2005, 10:00 AM
Authorized User
 
Join Date: Jan 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I finally got it. I used a text box, txtCount, that did a running sum of the records and then used this code to diplay the label where needed.

If Me.txtCount.Value = 1 Then
    Me.lblProjects.Visible = True
ElseIf Me.txtCount.Value > 1 Then
    Me.lblProjects.Visible = False
End If

thanks for the help






Similar Threads
Thread Thread Starter Forum Replies Last Post
display carriage returns in label bleitner ASP.NET 2.0 Professional 4 May 21st, 2011 12:10 PM
How To Display ToolTip for label control maulik33 ASP.NET 2.0 Basics 1 August 27th, 2007 08:42 AM
SubTotal() to display in a label JayLou BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 April 11th, 2007 10:18 AM
Display Label in Arabic shashikumar Visual Studio 2005 1 August 4th, 2006 05:10 AM
label cant display total value... pls help life_s Ng General .NET 2 August 20th, 2004 02:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.