Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1658
  • Last Modified:

datasheet - question 8 - can the column heading be made BOLD?

Hi EE,

I made the column's lable BOLD, by clicking B, - it's bold in design view
             yet NOT bold                                                        in datasheet view.

Is there a way to do this via VBA?
tx, sandra
0
mytfein
Asked:
mytfein
  • 13
  • 10
  • 6
4 Solutions
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:


Me.DatasheetFontWeight = 700

mx
0
 
TextReportCommented:
If you set the FontWeight, this sets the data as well as the column heading to bold. You can then use the conditional format of Expression of TRUE and set it to be not bold if this is what you are after.
Cheers, Andrew
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Yes ... sorry, forgot to mention that ... and a good idea about using CF.

mx
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
mytfeinAuthor Commented:
Hi Andrew,
a) Recently DBmx offered this web link for alternate coloring of rows
    http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_24265237.html

b) have not had a chance to look at (a), primarily bec. I'm not well versed in custom classes in OOP
c) yes, i'd like only column headers to be bold
     i do not know how to code your suggestion
          i only know how to do conditional formatiing
          via menu/formatting/conditional for these situations:
               1) if field got focus - set back color to yellow
               2) if field = "somevalue" set back color (to differentiate rows on continuous rows form)

can you offer more guidance, pls?
tx, s
     
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
FYI ... other Font Weights (from Help):

In Visual Basic, the DatasheetFontWeight property setting uses the following Integer values.

Setting Description
100 Thin
200 Extra Light
300 Light
400 (Default) Normal
500 Medium
600 Semi-bold
700 Bold
800 Extra Bold
900 Heavy


mx
0
 
mytfeinAuthor Commented:
hi mx,

oic, that explains why you chose 700

yet i wish to apply bold only to column headings, not to *entire* datasheet

tx, s
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Actually, I'm not seeing the labels bold, are you ?

mx
0
 
mytfeinAuthor Commented:
hi mx,

a) I put in your suggestion:
   Me.DatasheetFontWeight = 700
the datasheet is bold, yet i just want the headers to be bold for contrast....

b) do you agree that if you change a datasheet property, that change becomes the default bec.
    now i have to code:
            Me.DatasheetFontWeight = 400
       to set font back to normal weight..... tx, s
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
I think what Andrew is suggesting is ... to keep the cells (text boxes) from being bold, for each text box, you can add Conditional Formatting to each text box like so:

Condition:  Expression Is
Argument:  True

Then set the color you want ... But ... do not select B (bold).  Since the expression will always be True ... it will make the text boxes NOT bold.

b)  I guess if you save it after opening, it will retain that setting.

mx

0
 
mytfeinAuthor Commented:
hi mx,

tx for all your help, today,

i'll pick this up again tommorrow..... have a good evening....

tx, s
0
 
TextReportCommented:
Hi Sarah and mx, Ive been away for 5 minutes (ok a couple of hours) and all these posts. MX you are correct in what I was trying to suggest but this still leave it that ALL headings will be bold.

Sarah with regards to setting he alternative lines shouldn't be an issue as you just need to set the fontweight in the conditional formating for all conditions you specify.

Cheers, Andrew
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
I cannot get the headings to go Bold with

Me.DatasheetFontWeight = 400

only the text boxes.

What am I missing ?

mx
0
 
mytfeinAuthor Commented:
Good morning Andrew,
Tried your suggestion this morning, just for one cell(column): In the following manner:

My datasheet columns are locked except for the column: cboRejectReason.
The datasheet back color is set to an olive green.
I want the color of the cboRejectReason column to be white, so the user know that is a key-able control.

So using your suggestion, (while that was not the original purpose of this post - this post related
to datasheet headings) did the following:

clicked on: cboRejectReason
                        Format/Conditional Formatting
                                changed to Expression Is     tabbed over and typed:  True
                                         set back color to white, and text to BOLD

It worked!  thx sooo much,  Any ideas about column headings, though :), tx, s
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
sandra ... are you column headings Bold ?

mx
0
 
mytfeinAuthor Commented:
Hi mx,

a) no, column headings are not bold

b) (This morning, I posted on a yahoogroup  (ms_access_professionals2yahoogroups.com
and got this response from an Access author.

Sandra-

No, you can't modify the column headings separately. In Datasheet view of a
form, you can change the font or bold or underline, but that affects the
entire view. If you want the "look" of a datasheet with bold headings,
design a Continuous Form with the column labels lined up across the form
header and the controls for the data lined up right underneath. When you do
that, you can modify each control individually. The downside is you lose
the ability to resize the columns when in form view, but that could be a
good thing. In a datasheet, a user can accidentally hide a column by
shrinking it to zero width

John Viescas, author
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas. com/
(Paris, France)

c) mx, on another post you uploaded a screenp.shot to EE to prove a point as a .GIF.
i was inspired, and pasted the screenshot into PAINT and saved it as bmp

Did you do that same process to upload your screen shot?
tx, s
a-datasheet-screenshot.bmp
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
a)  I cannot seem to make the col heading bold with the  Me.DatasheetFontWeight = 700 command ... which I *thought* in the past it did ... as well as the cells!!  So, I'm confused.

b)  John V probably knows what he is talking about :-)

c) I use Robo Screen Capture ... available from Adobe - which bought the original company.

mx
0
 
mytfeinAuthor Commented:
Thx guys for your help....

Dear Public:
    It seems that datasheet headings CANNOT  be modified
    Since Andrew and DBmx offered ideas as to how to modify datasheet cells, that is useful to,
       and I did get it to work, so that's where the points are going to.

tx, s
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
I *know* I seen the headings go bold ... at the same time the cells do ... with that one line of code.  But for some reason, I cannot reproduce that right now.  I will post back if I do.

thx.mx
0
 
TextReportCommented:
Hi the code below is rand from a command button on the main form to change the fontweight of the sub form in datasheet view. The datasheet has conditional formatting on so the records do not get affected but the headings do.

Cheers, Andrew
    If Me.frmSub.Form.DatasheetFontWeight <> 700 Then
       Me.frmSub.Form.DatasheetFontWeight = 700
    Else
       Me.frmSub.Form.DatasheetFontWeight = 400
    End If

Open in new window

0
 
mytfeinAuthor Commented:
Andrew,
thx for writing...

a) i understand that in the code above you are using the command button as a "toggle" switch.
b) i do not understand what you want me to do for conditional formatting. can you please explain
     or post a screen shot. thx...

c) Truthfully, I do not understand your previous suggestion that works of:
    Formatting/Conditional Formatting:
               Expression    is True

      does Expression is True - mean that the cell has data?

tx, sandra
0
 
TextReportCommented:
Hi Sandra, the conditional format for every control is set as below, the Expression True means that all values for each control will use this Conditional Format and therefore set the font to NOT BOLD. Hope this demonstrates what you are after.
Cheers, Andrew
ConditionalFormat.jpg
Form-Normal.jpg
Form-Bold.jpg
0
 
mytfeinAuthor Commented:
Also, Andrew:
    would like to  confirm what mx said: that headings are not bold by the following statement:
     here is a screen shot, of data bolded, but not the headers

With subStudentDetail.Form
        .DatasheetFontWeight = 700
end with
a-datasheet-screenshot-allbold.bmp
0
 
TextReportCommented:
As you can see from my screen shots setting the DatasheetFontWeight affects the column headings, this is in Access 2007.
Can you confirm that the DataSheetFontWeight has been set to 700 and also what the conditional formating is for the controls.
Cheers, Andrew
0
 
mytfeinAuthor Commented:
Andrew,
Thx sooo much for taking the time to upload screenshots.

I understand your explanation.
    I changed all controls instead of the checbox control to:
              Expression Is true

I use A2003 - headings still not bold....
Maybe only A2007 can do this....

I have to leave shortly... if  you like, can i post the mdb on Sun/Mon for you to test on  A2007 ?
tx for your help on this issue, sandra

tx, s
090424-confform.bmp
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
sandra ... just an fyi ... try to up load JPG's or GIF's .... which are much smaller and faster than BMP ...

thx.mx
0
 
mytfeinAuthor Commented:
hi mx,

oic... will know for next time... tx... have a nice weekend everyone, sandra
0
 
TextReportCommented:
Hi Sandra, "I use A2003 - headings still not bold.... Maybe only A2007 can do this...." I did look at setting this in Access 2002 but I had problems so I didn't persue it, I suspect it is a 2007 thing. Interesting to note though changing the DatasheetForeColor doesn't change the headings / titles in 2007.

Yes I can test your example in Access 2007 for you.

Cheers, Andrew
0
 
mytfeinAuthor Commented:
Andrew,
thx sooooooo much for helping me with this.....

i will send you on Monday the mdb, thx, bec. have to leave for weekend now...

be well, s
0
 
mytfeinAuthor Commented:
Hi Andrew,
Some time ago you kindly offered to test my mdb in Access 2007 for the datasheet's font's headings.
Although, I have A2003 at work, this mdb is 2000 version, bec. at home I have A2000.
 
I was waiting to give you a neater version, it still needs more work....
   (also, this is my first exposure to tree control, so a friend did most of the coding)

If this takes longer than 10 minutes, then I do not want you to spend time on it....
tx very much, sandra
db1.mdb
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 13
  • 10
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now