Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 21st, 2005, 03:55 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
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?

Reply With Quote
  #2 (permalink)  
Old January 22nd, 2005, 05:49 AM
Authorized User
 
Join Date: Jul 2003
Location: Stockton on Tees, , United Kingdom.
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
Reply With Quote
  #3 (permalink)  
Old January 24th, 2005, 09:50 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
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.


Reply With Quote
  #4 (permalink)  
Old January 24th, 2005, 04:54 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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
Reply With Quote
  #5 (permalink)  
Old January 25th, 2005, 08:57 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
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.

Reply With Quote
  #6 (permalink)  
Old January 25th, 2005, 11:17 AM
Authorized User
 
Join Date: Jul 2003
Location: Stockton on Tees, , United Kingdom.
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
Reply With Quote
  #7 (permalink)  
Old January 26th, 2005, 10:00 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
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

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
display carriage returns in label bleitner ASP.NET 2.0 Professional 4 May 21st, 2011 01:10 PM
How To Display ToolTip for label control maulik33 ASP.NET 2.0 Basics 1 August 27th, 2007 09: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 11:18 AM
Display Label in Arabic shashikumar Visual Studio 2005 1 August 4th, 2006 06:10 AM
label cant display total value... pls help life_s Ng General .NET 2 August 20th, 2004 03:17 AM



All times are GMT -4. The time now is 01:01 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.