Bold report column based on month

I have a report with a column for each month. (Jan, Feb, Mar...)
I'd like to bold the data in the column that the report is run for.
I placed this code in the on Format event of the report to test, the code is 
executing ok but the columns end up all in normal weight.
  m = DatePart("m", dt)
  Select Case m
  Case 1
    Me.Jan.FontWeight = vbBold
    Me.Feb.FontWeight = vbNormal
    Me.Mar.FontWeight = vbNormal
    Me.Apr.FontWeight = vbNormal
    Me.May.FontWeight = vbNormal
    Me.Jun.FontWeight = vbNormal
    Me.Jul.FontWeight = vbNormal
    Me.Aug.FontWeight = vbNormal
    Me.Sep.FontWeight = vbNormal
    Me.Oct.FontWeight = vbNormal
    Me.Nov.FontWeight = vbNormal
    Me.Dec.FontWeight = vbNormal
  Case 2
    Me.Jan.FontWeight = vbNormal
    Me.Feb.FontWeight = vbBold
    Me.Mar.FontWeight = vbNormal
    Me.Apr.FontWeight = vbNormal
    Me.May.FontWeight = vbNormal
    Me.Jun.FontWeight = vbNormal
    Me.Jul.FontWeight = vbNormal
    Me.Aug.FontWeight = vbNormal
    Me.Sep.FontWeight = vbNormal
    Me.Oct.FontWeight = vbNormal
    Me.Nov.FontWeight = vbNormal
    Me.Dec.FontWeight = vbNormal
  End Select
Any help would be appreciated.
Thanks

0
Utf
3/1/2008 2:08:41 AM
access.reports 4434 articles. 0 followers. Follow

4 Replies
757 Views

Similar Articles

[PageSpeed] 11

Hi Chuck,

My version of Access (A2002) does not have a built-in constant named vbBold. 
It does have a vbNormal constant, but that's one of the Dir constants.

The simplest way to bold (or not bold) the font in a textbox is as follows:
    Me.ControlName.FontBold = True  'or False

You can use the FontWeight property, but you need to assign a numeric value 
to it; see the Help file for details.

HTH,

Rob

"Chuck" <Chuck@discussions.microsoft.com> wrote in message 
news:47DAD9CA-15D9-42F4-924A-3715C436B107@microsoft.com...
>I have a report with a column for each month. (Jan, Feb, Mar...)
> I'd like to bold the data in the column that the report is run for.
> I placed this code in the on Format event of the report to test, the code 
> is
> executing ok but the columns end up all in normal weight.
>  m = DatePart("m", dt)
>  Select Case m
>  Case 1
>    Me.Jan.FontWeight = vbBold
>    Me.Feb.FontWeight = vbNormal
>    Me.Mar.FontWeight = vbNormal
>    Me.Apr.FontWeight = vbNormal
>    Me.May.FontWeight = vbNormal
>    Me.Jun.FontWeight = vbNormal
>    Me.Jul.FontWeight = vbNormal
>    Me.Aug.FontWeight = vbNormal
>    Me.Sep.FontWeight = vbNormal
>    Me.Oct.FontWeight = vbNormal
>    Me.Nov.FontWeight = vbNormal
>    Me.Dec.FontWeight = vbNormal
>  Case 2
>    Me.Jan.FontWeight = vbNormal
>    Me.Feb.FontWeight = vbBold
>    Me.Mar.FontWeight = vbNormal
>    Me.Apr.FontWeight = vbNormal
>    Me.May.FontWeight = vbNormal
>    Me.Jun.FontWeight = vbNormal
>    Me.Jul.FontWeight = vbNormal
>    Me.Aug.FontWeight = vbNormal
>    Me.Sep.FontWeight = vbNormal
>    Me.Oct.FontWeight = vbNormal
>    Me.Nov.FontWeight = vbNormal
>    Me.Dec.FontWeight = vbNormal
>  End Select
> Any help would be appreciated.
> Thanks
> 

0
Rob
3/1/2008 3:17:20 AM
Thank you Rob, worked great.
Is there a place where the constants are listed?
Chuck

"Rob Parker" wrote:

> Hi Chuck,
> 
> My version of Access (A2002) does not have a built-in constant named vbBold. 
> It does have a vbNormal constant, but that's one of the Dir constants.
> 
> The simplest way to bold (or not bold) the font in a textbox is as follows:
>     Me.ControlName.FontBold = True  'or False
> 
> You can use the FontWeight property, but you need to assign a numeric value 
> to it; see the Help file for details.
> 
> HTH,
> 
> Rob
> 
> "Chuck" <Chuck@discussions.microsoft.com> wrote in message 
> news:47DAD9CA-15D9-42F4-924A-3715C436B107@microsoft.com...
> >I have a report with a column for each month. (Jan, Feb, Mar...)
> > I'd like to bold the data in the column that the report is run for.
> > I placed this code in the on Format event of the report to test, the code 
> > is
> > executing ok but the columns end up all in normal weight.
> >  m = DatePart("m", dt)
> >  Select Case m
> >  Case 1
> >    Me.Jan.FontWeight = vbBold
> >    Me.Feb.FontWeight = vbNormal
> >    Me.Mar.FontWeight = vbNormal
> >    Me.Apr.FontWeight = vbNormal
> >    Me.May.FontWeight = vbNormal
> >    Me.Jun.FontWeight = vbNormal
> >    Me.Jul.FontWeight = vbNormal
> >    Me.Aug.FontWeight = vbNormal
> >    Me.Sep.FontWeight = vbNormal
> >    Me.Oct.FontWeight = vbNormal
> >    Me.Nov.FontWeight = vbNormal
> >    Me.Dec.FontWeight = vbNormal
> >  Case 2
> >    Me.Jan.FontWeight = vbNormal
> >    Me.Feb.FontWeight = vbBold
> >    Me.Mar.FontWeight = vbNormal
> >    Me.Apr.FontWeight = vbNormal
> >    Me.May.FontWeight = vbNormal
> >    Me.Jun.FontWeight = vbNormal
> >    Me.Jul.FontWeight = vbNormal
> >    Me.Aug.FontWeight = vbNormal
> >    Me.Sep.FontWeight = vbNormal
> >    Me.Oct.FontWeight = vbNormal
> >    Me.Nov.FontWeight = vbNormal
> >    Me.Dec.FontWeight = vbNormal
> >  End Select
> > Any help would be appreciated.
> > Thanks
> > 
> 
> 
0
Utf
3/1/2008 5:37:02 PM
You might want to revise the code a bit.

Dim strM as String
strM = Format(dt,"mmm")

    Me.Jan.Fontbold = "Jan" = strM
    Me.Feb.Fontbold = "Feb" = strM
    Me.Mar.Fontbold = "Mar" = strM
    ...
    Me.Dec.Fontbold = "Dec" = StrM

That way you need twelve lines of code to flip bolding on and off 
instead of 12 cases with 12 lines for each case.

Or
Set all the controls fontbold to False and then set the relevant one to true


Dim strM as String
strM = Format(dt,"mmm")
    ME.Jan.Fontbold = False
    ...
    Me.Dec.Fontbold = False

    Me.Controls(strM).FontBold = True

Either of those two would be a lot easier to change if you decided you 
wanted Italic instead of bold.  Or a color change for the font.

'====================================================
  John Spencer
  Access MVP 2002-2005, 2007-2008
  Center for Health Program Development and Management
  University of Maryland Baltimore County
'====================================================


Chuck wrote:
> Thank you Rob, worked great.
> Is there a place where the constants are listed?
> Chuck
> 
> "Rob Parker" wrote:
> 
>> Hi Chuck,
>>
>> My version of Access (A2002) does not have a built-in constant named vbBold. 
>> It does have a vbNormal constant, but that's one of the Dir constants.
>>
>> The simplest way to bold (or not bold) the font in a textbox is as follows:
>>     Me.ControlName.FontBold = True  'or False
>>
>> You can use the FontWeight property, but you need to assign a numeric value 
>> to it; see the Help file for details.
>>
>> HTH,
>>
>> Rob
>>
>> "Chuck" <Chuck@discussions.microsoft.com> wrote in message 
>> news:47DAD9CA-15D9-42F4-924A-3715C436B107@microsoft.com...
>>> I have a report with a column for each month. (Jan, Feb, Mar...)
>>> I'd like to bold the data in the column that the report is run for.
>>> I placed this code in the on Format event of the report to test, the code 
>>> is
>>> executing ok but the columns end up all in normal weight.
>>>  m = DatePart("m", dt)
>>>  Select Case m
>>>  Case 1
>>>    Me.Jan.FontWeight = vbBold
>>>    Me.Feb.FontWeight = vbNormal
>>>    Me.Mar.FontWeight = vbNormal
>>>    Me.Apr.FontWeight = vbNormal
>>>    Me.May.FontWeight = vbNormal
>>>    Me.Jun.FontWeight = vbNormal
>>>    Me.Jul.FontWeight = vbNormal
>>>    Me.Aug.FontWeight = vbNormal
>>>    Me.Sep.FontWeight = vbNormal
>>>    Me.Oct.FontWeight = vbNormal
>>>    Me.Nov.FontWeight = vbNormal
>>>    Me.Dec.FontWeight = vbNormal
>>>  Case 2
>>>    Me.Jan.FontWeight = vbNormal
>>>    Me.Feb.FontWeight = vbBold
>>>    Me.Mar.FontWeight = vbNormal
>>>    Me.Apr.FontWeight = vbNormal
>>>    Me.May.FontWeight = vbNormal
>>>    Me.Jun.FontWeight = vbNormal
>>>    Me.Jul.FontWeight = vbNormal
>>>    Me.Aug.FontWeight = vbNormal
>>>    Me.Sep.FontWeight = vbNormal
>>>    Me.Oct.FontWeight = vbNormal
>>>    Me.Nov.FontWeight = vbNormal
>>>    Me.Dec.FontWeight = vbNormal
>>>  End Select
>>> Any help would be appreciated.
>>> Thanks
>>>
>>
0
John
3/1/2008 7:24:29 PM
Hi Chuck,

They're listed in the Visual Basic Help file (accessed from the VBA editor - 
it's not the Access Help file).

In the Contents tab, expand the Visual Basic Language Reference volume. 
Then read, learn and inwardly difgest to yout heart's content ;-)

Rob

"Chuck" <Chuck@discussions.microsoft.com> wrote in message 
news:7B1C7388-1A2C-403D-8CD2-80AE288DFDE5@microsoft.com...
> Thank you Rob, worked great.
> Is there a place where the constants are listed?
> Chuck
>
<snip> 

0
Rob
3/2/2008 1:10:13 AM
Reply:

Similar Artilces:

SetupDiOpenDeviceInfo
Hi, I'm trying to add device instances to a DeviceInfoSet using SetupDiOpenDeviceInfo(), but the DeviceInstanceId parameter is not accepting any wildcard characters in it. For example, I want to add all device instances with "USB\\MyVendorID\\*" or "USB\\MyVendorID\\0000" if 0000 could match anything perhaps, but the call fails with ERROR_NO_SUCH_DEVINST. My question is, how do I add all devices belonging to the logical group "USB\\MyVendorID" to the DeviceInfoSet? TIA, JY you need to wake the tree and look at each devnode to find a matc...

my column headers has changed to numeric from alphabetcal order #2
I have come across strange problem ..my column names has chnaged to numeric from alphabet and now none of my formulaes work as all the cell names show up as R1C1 , R1C2 and so on... Anyone knows what have i messed up ??? Hi Annie, Try: Tools | Options | General Tab | Uncheck R1C1 reference style. --- Regards, Norman "Annie" <Annie@discussions.microsoft.com> wrote in message news:1FE6319D-59BD-4BEE-9C77-B8B97AC78CEF@microsoft.com... >I have come across strange problem ..my column names has chnaged to numeric > from alphabet and now none of my formulaes work ...

Increasing number of columns in spreadsheet
Someone has reduced the number of columns in the spreadsheet I'm using just to A - AD. I need to increase the size of the spreadsheet back to standard number of columns. How do I do this? Hi! They're probably just hidden. Select column AD header and drag a few inches to the right. Then right click within column AD and select Unhide. Biff >-----Original Message----- >Someone has reduced the number of columns in the spreadsheet I'm using just >to A - AD. > >I need to increase the size of the spreadsheet back to standard number of >columns. How do I ...

Register Analysis report & Z report?? HELP!!
Is there a report that list the information from the z Report? I know how to obtain the tender amounts, sales, sales amounts. The information I am after is Paid on Layaway/ Closed , Paid to Account and especially Deposit Made/Redeemed. I would love one report but multiple reports are ok. I haven't been able to fully intergrate yet with Quickbooks by journal entry. If I can run weekly/monthly reports that have this information on it I can export it to a excel spreadsheet then import into my Peachtree. Any help would be greatly appreciated? I read on the newsgroup something ab...

Smart List Report
I am trying to create a report in smart list that will allow me to pull the "Orig. Master Number" -- esk ------=_NextPart_0001_EA5A4E0D Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello, Are you trying to pull out the Master number or the Originating document number? You would be able to do both by utilizing the "Sales Transactions" Smartlist. 1. Open Smartlist (View | Smartlist). 2. Select Sales Transactions. 3. Click on the Columns button at the top. 4. Click on the Add button. 5. Scroll thru the list then select either Original Number or Master Num...

How do you print one record from a Report?
In Access 2007 how is it possible to print one single record or choose a couple of records from an Access 2007 Report? i know how to print one single record from an Access 2007 Form, but not Report. "hsmonsivais" wrote: > In Access 2007 how is it possible to print one single record or choose a > couple of records from an Access 2007 Report? > > i know how to print one single record from an Access 2007 Form, but not > Report. By the way I am recently learning how to use Access. I would appreciate if you are not to Technical. THANK YOU. ...

Migrate AFA report to FRx
Hi, I was trying to migrating a AFA(Advanced Financial Analysis) P&L report into FRx. A Row type was designated as Net Profit. How to achieve the same in FRx. Thanks in Advance, Arun. Hi Arun, There is no automatic net profit calculation row available in FRx like AFA you need to obtain it by formula calculation in FRx last row. All the best. -- Developer "Arun" wrote: > Hi, > > I was trying to migrating a AFA(Advanced Financial Analysis) P&L report into > FRx. A Row type was designated as Net Profit. How to achieve the sa...

Accessing base class operators
Hi, I have a class :- class CTimeCode : public CTime { ... blah ... void SetTime( const CString &csWeirdDateFormat ) ; } Then function void CTimeCode::SetTime( const CString &csWeirdDateFormat ) { .. convert string to integer year, month, .. day, etc and try to save in base class CTime (WotGoesHere?) = CTime( Year, Month, Day ...... ) ; } You guessed it, what do I type in place of (WotGoesHere?) ???? My guess was it'd be "this" or "*this" but nope :-( TTFN, Jon Use this: CTime::operator=(CTime(2003, 10, 14, 12, 12, 12)); >...

Need to block emails based on content
Following the latest virus/worm, my Exchange server is overrun with CIA/FBI/"I've a new email address" type of emails. I already have IMF installed but this tool is not maintained and updated well. I am looking for a good solution to block emails based on their content and send them to the Junk folders. Something that would work hand in hand with IMF or in concurrence with IMF would be nice. Thanks a bunch! In news:43947528$0$3765$39cecf19@news.twtelecom.net, Nicolas Verhaeghe - White Echo <nospam_nicolas@whiteecho.com_nospam> typed: > Following the latest ...

Formula- to create drop down down list based on diff criteria
Hi, I needa formula where if i select a certain department all the people in that department will appear in a drop down list in the template. i am wondering if we could use IF function to do this.... to give more perspective i am trying to build a travel template which can be used by all departments in the company to plan their trips but instead of creating multiple tabs for each department i am wondering if i could simply create one template and when anyone selects their department it would automatically put a list of the people (similar to the way a pivot works but cannot have a...

Can you copy email addresses in to new column out of Hyperlink column
I had been using Excel worksheet as my contacts manager. It contains columns last name, first name, addr, tel, and Email address(as hyperlink). I am trying to import this data into outlook. Unfortunaltey Outlook requires email addresses as text field and Hyperlink field. Any clue, how I can copy addresses out of hyperlinks through full column into new column with email address as Text only P Dear PM Try this... Select and copy the entire column of hyperlinked email addresses, then in your new column paste special, values. this should hopefully do the trick. Hope this helps Paul Fal...

Customising monthly reports?
Hello, I'm just starting out using Money. One thing that's annoying me is that I can't see how to customise the monthly report. I have income and expenditure from a small business which I don't want to see on this report. I've removed the relevant categories from other reports, but I don't seem able to do it on the monthly report, and consequently the figures are skewed and pretty much useless to me. I'm I stuck with this? Cheers! Martin Pretty much. <martin_pentreath@hotmail.com> wrote in message news:1175465343.267759.95030@p15g2000hsd.googlegroups.c...

Stacked Column Chart #3
I seem to be having the hardest time in the world completing this chart! I hope someone can help.. Here's what I'm trying to do: I have a row titled Total amount, then four other rows above it, (for discussion sake we'll say they are A, B, C, D) the column next to those titles has the values. In "A", I've got the number 0 In "B", I've got the number 24 In "C", I've got the number 9 In "D", I've got the number 8 For "Total", I've got 41 I need to show a stacked column chart where: "Total" ...

excel adding up columns
I have created a worksheet and put in a formula to add together 4 cells. the resulting total is 1p less than when I add it together manually. How can this be? -- kinsey See http://www.mcgimpsey.com/excel/pennyoff.html In article <E1F1086E-6DF1-47E0-8376-7644E6874D07@microsoft.com>, kinsey <kinsey@discussions.microsoft.com> wrote: > I have created a worksheet and put in a formula to add together 4 cells. > the resulting total is 1p less than when I add it together manually. > How can this be? Many thanks, how do I change this in 2007 version? -- kinsey &qu...

Unrealized Capital Gains Reports
This is a new problem. When I sell a partial lot of a given stock, and refresh the "Portfolio Value by Account or Investment" report, the cost column doesn't change to reflect the lower share count. Here is a specific example: Have 200 share of xyz at a cost of $20/share. Prior to selling a partial lot, the report gives the correct unrealized gain information with a total cost of $4,000. When I sell 50 shares, and refresh the report, the cost column stays at $4000 and recalculates the unrealized gain of the remaining 150 share as if the remaining shares were at a co...

Crystal Reports 10 Licensing
At Convergence, I spoke to the people at the Crystal booth and the impression was that the pricing structure had changed substantially and now the bulk of the expense is with the licenses to view the reports as opposed to the licenses to write the reports. Do you have any pricing details for the latest version of Crystal? I've developed a vb.net application that uses Crystal's API calls to deliver reports on a citrix server and that eliminates to have user licenses. >-----Original Message----- >At Convergence, I spoke to the people at the Crystal >booth and the i...

.Filter for multi criteria based filteration.
How can I join two .Filter statements so as to apply multiple criteria. Please rewrite the following code in this regard, because it results into a filter being applied first on Cl = CL basis, then CHANGES the same to Set = ID basis, whereas, I require both conditions to be met. Forms![COA].Filter = "[Cl] = " & """" & Me.CL & """" Forms![COA].Filter = "[Set] = " & """" & Me.ID & """" -- Thanx & Best Regards, Faraz! Combine the 2 into a string, like...

Vlookup based on a unique "Text" occur
My vlookup range starts based on a unique "Text" occur once in a cell in B:B and end when the same occur once in a cell in A:A Within this target range of rows there are unique texts like text-1,text-2, text-3ā€¦ and so on belongs to the "Text" and they are in A:A but unevenly spaced. I need vlookup values located in row of col C:C. Below is example. "Text" Text1 50 Text2 60 Text3 45 Text4 50 Text5 20 Text6 80 "Text" Thanks for any help to resolve this ...

Formula
Hi there Iā€™d first like to start out by thanking anyone who can help me out with this issue but that, for many of my own reasons which are very valid, I cannot use a VBA solution ā€“ only a formula based solution. I have seven columns of data. Most entries overlap throughout the columns but I need to find every unique entry in all of these columns. My results need to be shown in one neat column with no spaces in between entries. I have vastly simplified the amount of data for this example ā€“ this is usually over 500 lines for each column and I have about 40 columns, some of the column...

Documenting Smartlist Reports beyond report name
Is there a way to document within GP further information about smartlists. I would like to be able to write a 2 or 3 sentence explanation of the uses of the report, etc. that would be readily available such as in a report properties but I don't see any such capability. ...

How do I create a monthly/fortnightly employee roster/timesheet?
Excel timesheet including variable start and finish times for different employees over a fortnightly period. Should be capable of charting numerous employees and indicating when they are on annual leave, on call, rostered on, over-time etc. Different coloured cells would indicate different duties ie. ROSTERED ON NORMAL DUTIES COMPLAINTS NORTH COMPLAINTS SOUTH/POUND PARKING ON CALL and leave ie. ROSTERED DAY OFF ALLOCATED DAY OFF TIME IN LIEU PUBLIC SERVICE HOLIDAY PUBLIC HOLIDAY APPROVED REC LEAVE SICK / WORKERS COMP LEAVE OTHER LEAVE A legend would be required at top of spreadsheet. Sprea...

print of report is different than preview
I downloaded How to skip used mailing labels and print duplicates in Access 2002. It seems to be working fine until I try to print. It then prints from the first label and not as the preview showed. This is driving me buggy. What am I missing? The knoweldgebase article you referred to works for a single-page report. Provided you reset things in the Report Header's events, it should also work for printing (provided you print from the first page.) However, it does not work if you are printing reports that spill over onto several pages, unless you actually print all the pages. This i...

Need single column/row of numbers to print down then across pages in order
I have a very long list of phone numbers that occupies a1,a2, so on. approx. 45,000 records. I need to be able to print hard copies of these numbers so that it stays in order from page to page but is not just one column. (as to cut the # of pages from 300 to 50 or lesss) In other words, start in the top left corner of page through to bottom, next row, and so on. I thought there would be a way to set this up in printing options but to this point haven't figured it out. I have the same list (1 row again) also in Access if it would be easier. Would VERY much appreciate any clu...

Report Wrtier
On our POs the Line Item information in printed in two rows. On multi-page POs the last line item on will print one line of information and the other on page 2. Is there a way to keep the infomration together? We are on version 10. Report Writer engine is a single pass processing engine, this is, it navigates the tables that it uses to yield data on a report sequentially from top to bottom. This in turn means that Report Writer cannot go back to the previous record and figure out whether it needs to move it to another page before outputing the current record, and as you already kn...

Unable to Access Reports from CRM Interface
We have deployed Microsoft CRM, but there is problem that the reports cannot be accessed by using Microsoft CRM interface from client's machine. There is no problem accessing the report in local server, it can be shown correctly from CRM interface, if it's accessed in the CRM server/database server. There are two servers, one for CRM application and the other for database+report server. User can access the Report Manager interface from their local machine (http://dbserver/reports). Anyone has idea, what is the possible error? Thanks. there is a white paper that requires additional ...